没有不值得去解决的问题,也没有不值得去学习的技术!

Analyze and Resolve the “There Are No Enabled Repos” Error When Running yum makecache on CentOS 7.6 64-bit

On CentOS 7.6 64-bit, running the command: yum makecache to update the yum repository cache reports the error: There are no enabled repos

1. On CentOS 7.6 64-bit, I ran the command: yum makecache to update the yum repository cache, and it reported the error: There are no enabled repos, as shown in Figure 1.

On CentOS 7.6 64-bit, running the command: yum makecache to update the yum repository cache reports the error: There are no enabled repos
Figure 1
Plaintext
[root@iZ8vb0tg9av3a17vlbfi28Z ~]# yum makecache
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 
 To enable custom repositories:
     yum-config-manager --enable 


2. I decided to reinstall the 7.6 release package. First, I went to the Alibaba Cloud mirror website, found the corresponding release package, and copied its link, as shown in Figure 2.

Decided to reinstall the 7.6 release package; first went to the Alibaba Cloud mirror website, found the corresponding release package, and copied its link
Figure 2

3. I executed the following commands in sequence, as shown in Figure 3.

Execute the following commands in sequence
Figure 3
Bash
wget https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/centos-release-7-6.1810.2.el7.centos.x86_64.rpm
rpm -ivh --replacepkgs --replacefiles centos-release-7-6.1810.2.el7.centos.x86_64.rpm
yum update

4. I ran the command: yum makecache to update the yum repository cache. No error was reported this time, which is the expected result, as shown in Figure 4.

Run the command: yum makecache to update the yum repository cache; no error is reported, as expected
Figure 4
Plaintext
[root@iZ8vb0tg9av3a17vlbfi28Z ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.huaweicloud.com
 * updates: mirrors.huaweicloud.com
base                                              | 3.6 kB     00:00     
extras                                            | 3.4 kB     00:00     
updates                                           | 3.4 kB     00:00     
(1/8): extras/7/x86_64/prestodelta                  |  47 kB   00:00     
(2/8): extras/7/x86_64/filelists_db                 | 231 kB   00:00     
(3/8): extras/7/x86_64/other_db                     | 118 kB   00:00     
(4/8): updates/7/x86_64/prestodelta                 | 358 kB   00:00     
(5/8): updates/7/x86_64/other_db                    | 351 kB   00:00     
(6/8): updates/7/x86_64/filelists_db                | 2.2 MB   00:00     
(7/8): base/7/x86_64/other_db                       | 2.6 MB   00:00     
(8/8): base/7/x86_64/filelists_db                   | 7.1 MB   00:04     
Metadata Cache Created


关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系