CentOS7报错There are no enabled repos. Run "yum repolist all" to see the repos you have

时间:2019年6月4日 栏目:VPS教程 作者:赵 容 点击: 4,848 次

自营机房/高防服务器/高防VPS/美国高防/洛杉矶VPS/洛杉矶高防服务器

在一台CentOS7的服务器上遇到标题标错:

[root@localhost ~]# yum install -y wget
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 <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>

通过yum什么都不能安装,搜索了下解决方法,所以记录下来。

报错信息如图:

yum

解决方法为:

下载对应版本repo文件, 放入/etc/yum.repos.d/里,下载地址:http://mirrors.163.com/.help/centos.html

***因为我这台机器wget也不能用,所以我是下载到本地sftp上去的***

完成后,查看/etc/yum.repos.d文件夹下是否有了CentOS-Base.repo文件,然后生成缓存。

yum clean all 
yum makecache

最后再次执行我们之前报错的命令,已经OK了。

高防VPS/洛杉矶高防/高防服务器/20年老牌机房

声明: 博客仅为分享信息绝非推荐,网站不参与交易绝非中介,内容均仅代表个人观点绝非权威,读者请自行考虑后入手并自担风险!一分钱一分货仍是恒久不变之真理,未成年读者(包括生理和心理)请在监护人陪同下访问本站!本文由( 赵 容 )原创编译,转载请保留链接: CentOS7报错There are no enabled repos. Run "yum repolist all" to see the repos you have码字不易,谢绝复制粘贴!
关于使用: 本站主要分享服务器及VPS信息,不提供任何产品销售及代购,所有访客朋友请在国家法律法规许可范围内购买和使用产品,QQ群讨论:683851361.
关于安全: 任何IDC都有倒闭和跑路的可能,主机线路更不可控,月付和备份是您的最佳选择,请保持良好的、有规则的备份习惯.

CentOS7报错There are no enabled repos. Run "yum repolist all" to see the repos you have:目前有3 条留言

  1. 板凳
    yufan:

    你好,如何下载到本地sftp上去?

    2020-05-10 16:42 [回复]
    • 赵 容:

      sftp可以用FlashFXP之类的工具传上去的

      2020-05-10 21:16 [回复]
  2. 沙发
    webnoob:

    谢谢了 已解决

    2020-03-14 00:59 [回复]

发表评论


hostyun locvps

广而告之