关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

centos7运行yum遇到There are no enabled repos.

发布时间:2024/8/12 14:51:39
香港云服务器

centos7运行yum报如下提示:

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 

运行

yum repolist all

0

尝试:

yum -y install yum-utils

如果不能运行先试着更换yum源:

先备份源:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

然后

wget -O /etc/yum/repos.d/CentOS-Base.repo http://www.landui.com/repo/Centos-7.repo

或者

curl -o /etc/yum/repos.d/CentOS-Base.repo http://www.landui.com/repo/Centos-7.repo

文件目录看好:

/etc/yum/repos.d/

很快下载完成。

运行命令生成缓存

yum clean all

yum makecache

测试

yum -y install yum-utils

成功。