I have accidentally deleted all my repos and I'm unable to install any packages
I have accidentally deleted all my repos and I'm unable to install any packages
Running
sudo yum install {package}
returns
"Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d"
2 Replies
This topic came up on the Red Hat customer portal recently. The basic tenets of the approach here could work for CentOS or other distributions:
Using the Secure Copy Protocol (SCP), you can copy over the required files from a working system. In a cloud environment like Linode, the best way to do that would be to spin up a new Linode with the same distribution as yours top copy those files over from. Once this is complete, you can remove that Linode from your account. This will incur a cost, though a Nanode would be sufficient for this use.
If you would like to avoid the incurred cost of another Linode on your account, then you could take steps to locally mount the ISO image and extract the config files from it. Specifically for yum/CentOS 8, the link above provides steps for this approach.