centos7运行yum报如下提示:Run "yum repolist all" to see the repos you have
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 <repo> To enable custom repositories: yum-config-manager --enable <repo>
解决办法:
yum -y install yum-utils
然后你查看你的/etc/yum.repos.d文件夹下有没有出现CentOS-Base.repo文件
如果不能运行先试着更换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://mirrors.aliyun.com/repo/Centos-7.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果wget不能安装使用,就自己在网上下载scp移动到目录下执行下面命令:
yum clean all
yum makecache
安装完成后,再执行命令就可以了
本文作者:韩憨
本文链接:https://www.cnblogs.com/hanby/p/14254219.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步