Restore CentOS Repositories

Issues related to applications and software problems
Post Reply
yohahoy
Posts: 5
Joined: 2017/09/04 12:21:30

Restore CentOS Repositories

Post by yohahoy » 2017/09/04 12:24:08

Is there some actions to restore all current release repositories?
Please help.
Last edited by yohahoy on 2017/09/04 13:15:57, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 26314
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore Centos Repositories

Post by TrevorH » 2017/09/04 12:42:54

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.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

yohahoy
Posts: 5
Joined: 2017/09/04 12:21:30

Re: Restore Centos Repositories

Post by yohahoy » 2017/09/04 13:10:50

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?
Last edited by yohahoy on 2017/09/04 13:13:52, edited 1 time in total.

yohahoy
Posts: 5
Joined: 2017/09/04 12:21:30

Re: Restore Centos Repositories

Post by yohahoy » 2017/09/04 13:12:00

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.

yohahoy
Posts: 5
Joined: 2017/09/04 12:21:30

Re: Restore CentOS Repositories

Post by yohahoy » 2017/09/04 13:18:30

But ok I found base repo file. And this command works.

User avatar
TrevorH
Forum Moderator
Posts: 26314
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Restore CentOS Repositories

Post by TrevorH » 2017/09/04 16:29:27

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.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

yohahoy
Posts: 5
Joined: 2017/09/04 12:21:30

Re: Restore CentOS Repositories

Post by yohahoy » 2017/09/04 17:27:24

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.

Post Reply