最近在搭建本地仓库时,发现yum出现故障,无论是建立缓存还是清理缓存又或者安装软件时都出现如下的报错信息:
[root@sprixin yum.repo.d]# yum -y makecache
已加载插件:fastestmirror, langpacks
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>
通过使用yum repolist命令查看时,显示库的软件信息为0
在网上查了许多方法都没有得到解决,网上最多的说法便是repo配置文件有问题,检查多次配置没问题,经过各种尝试和实验最终找到了解决方法:
yum-config-manager --add-repo /etc/yum.repo.d/my.repo
没错,只需要上边一条命令即可解决,将自己配置的repo文件用yum-config-manager进行yum软件源添加即可,至此问题解决