Search code examples
centosyumcentos8

How to recover deleted yum.repos.d in Centos OS?


I accidentally deleted the yum.repos.d on centos 8(version centos-release-8.0-0.1905.0.9.el8.x86_64.rpm) and since then I am observing

**Error:There are no enable repos**

I tried to yum reinstall http://vault.centos.org/8.0.1905/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm but I am observing the message

"Could not find the host".

Anybody kind enough to help me out?

Edit:

I got the "Could not find host" part resolved, I am getting "SSL_ERROR_SYSCALL" instead now.

If it cannot be reversed, can anyone help me to install Python2 without yum or dfn. That will also do for me.


Solution

  • You should be able to restore the yum repository configuration by reinstalling the related package via rpm:

    rpm -iv --replacepkgs http://vault.centos.org/8.0.1905/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm