Centos7报错 “There are no enabled repos” 或 “Loaded plugins: fastestmirror”

在使用最小安装Centos7后,刚进入系统什么都没做,yum直接报错:

[root@localhost ~]# yum install wget -y
Loaded plugins: fastestmirror
Determining fastest mirrors
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>

在更改了fastestmirror.conf和yum.conf这两个文件后报错变成了:

        更改:将第一个文件中的enabled改成0,第二个文件中的plugins改成0

[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf
[root@localhost ~]# vi /etc/yum.conf
[root@localhost ~]# yum clean all
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>

之后发现原因是:缺少CentOS-Base.repo文件

下载地址:http://mirrors.163.com/.help/CentOS7-Base-163.repo

下载后放入/etc/yum.repos.d/文件夹中

由于rz命令无法使用,故使用xftp上传

上传完成后执行:

yum clean all

yum makecache

执行效果如下:

[root@localhost yum.repos.d]# yum clean all
Cleaning repos: base extras updates
[root@localhost yum.repos.d]# yum makecache
base                                                                                                                                                          | 3.6 kB  00:00:00     
extras                                                                                                                                                        | 2.9 kB  00:00:00     
updates                                                                                                                                                       | 2.9 kB  00:00:00     
(1/10): base/7/x86_64/group_gz                                                                                                                                | 153 kB  00:00:00     
(2/10): base/7/x86_64/filelists_db                                                                                                                            | 7.2 MB  00:00:02     
(3/10): base/7/x86_64/primary_db                                                                                                                              | 6.1 MB  00:00:01     
(4/10): extras/7/x86_64/primary_db                                                                                                                            | 250 kB  00:00:00     
(5/10): extras/7/x86_64/filelists_db                                                                                                                          | 303 kB  00:00:01     
(6/10): base/7/x86_64/other_db                                                                                                                                | 2.6 MB  00:00:01     
(7/10): extras/7/x86_64/other_db                                                                                                                              | 150 kB  00:00:00     
(8/10): updates/7/x86_64/filelists_db                                                                                                                         |  12 MB  00:00:06     
(9/10): updates/7/x86_64/other_db                                                                                                                             | 1.4 MB  00:00:00     
(10/10): updates/7/x86_64/primary_db                                                                                                                          |  22 MB  00:00:10     
Metadata Cache Created

大功告成!

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜雨听梧桐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值