How to rebuild /etc/yum.repos.d in CentOS

If you remove all the files in /etc/yum.repos.d you may see this error. You can restore using the way below.

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>
[22:09][~]# cat /etc/redhat-release
 CentOS Linux release 7.3.1611 (Core)

Check your version and reinstall using this way.

[22:09][~]# yum reinstall


2 thoughts on “How to rebuild /etc/yum.repos.d in CentOS”

  1. Maybe you know what is the proper link to .rpm for Red Hat Enterprise Linux release 8.0 (Ootpa)?

  2. How to rebuild it on Red Hat Enterprise Linux release 8.0 (Ootpa)? I’m testing this OS on AWS EC2 and this is my lab excercise :)

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.