yum执行出错,There are no enabled repos

1.问题
  手贱把yum源CentOS-Base.repo删除了执行yum install wget报错There are no enabled repos. Run "yum repolist all" to see the repos you have.

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执行出错,There are no enabled repos_第1张图片
执行yum repolist all查询发现无可用仓库,全部被禁用
yum执行出错,There are no enabled repos_第2张图片

2.解决

在/etc/yum.repos.d/目录下执行

curl -o  CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

获取阿里云仓库配置
在这里插入图片描述

你可能感兴趣的:(异常处理,linux,命令,linux,异常处理)