Page 1 of 1

Restore CentOS Repositories

Posted: 2017/09/04 12:24:08
by yohahoy
Is there some actions to restore all current release repositories?
Please help.

Re: Restore Centos Repositories

Posted: 2017/09/04 12:42:54
by TrevorH
The CentOS supplied files live under /etc/yum.repos.d and mostly should be owned by the centos-release package. Using yum reinstall centos-release should create new .rpmnew packages for any that have been modified. If you've broken it to the point where yum reinstall won't work then download the most recent centos-release rpm from one of the mirrors and use yum localinstall on the downloaded file.

Re: Restore Centos Repositories

Posted: 2017/09/04 13:10:50
by yohahoy
I removed all inside /etc/yum.repos.d
Do command

Code: Select all

yum reinstall centos-release
getting:

Code: Select all

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>
So this command is not complete, maybe we need to do something more?

Re: Restore Centos Repositories

Posted: 2017/09/04 13:12:00
by yohahoy
I need to clean this folder to start all from scratch.
And its real remote server.
So maybe I need some rpm containing this data or anything related.
Thanks in advance.

Re: Restore CentOS Repositories

Posted: 2017/09/04 13:18:30
by yohahoy
But ok I found base repo file. And this command works.

Re: Restore CentOS Repositories

Posted: 2017/09/04 16:29:27
by TrevorH
If you remove the contents of /etc/yum.repos.d/ *before* you use yum then it has no repos to use! This is why I suggested doing the reinstall and then using the .rpmnew files that will create.

Re: Restore CentOS Repositories

Posted: 2017/09/04 17:27:24
by yohahoy
TrevorH wrote:If you remove the contents of /etc/yum.repos.d/ *before* you use yum then it has no repos to use! This is why I suggested doing the reinstall and then using the .rpmnew files that will create.
Thank you for helping.