1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 网站技术 - 正文

君子好学,自强不息!

centos yum无法使用怎么解决

2022-11-02 | 网站技术 | 1818ip | 579°c
A+ A-
可能大家还对“centos yum无法使用怎么解决”有些不明白,下面由1818ip小编来为大家解答一下,现在我们来一起看看吧!

在用yum安装gcc的时候,报了错误:

[root@001 ~]#yum -y install gcc gcc-c++ kernel-devel
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 repos --enable 
 To enable custom repositories:
     yum-config-manager --enable

1、检查是否断网

ping www.baidu.com

2、如果没断网,则说明是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

以上就是“centos yum无法使用怎么解决”的详细内容,更多请关注1818ip网其它相关文章!

本文来源:1818IP

本文地址:https://www.1818ip.com/post/6576.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。