centos7的yum报错 subscription-manager repo

步衡
2023-12-01

一、报错信息

当利用yum安装软件时,会产生下面产生的错误时,错误代码如下所示:
Loaded plugins: 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 repo

二、原因及其解决方法

这是因为yum更新源出现问题,可以下述输入以下命令进行解决。

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
yum clean all
 类似资料: