当前位置: 首页 > 新闻动态 > 技术教程

centos yum无法使用怎么解决

作者:尚 浏览: 发布日期:2020-03-25
[导读]:centos yum无法使用的解决方法:先检查是否断网。若没有断网说明yum的镜像没有了,重新下载yum镜像即可。

在用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

相关视频教程推荐:linux视频教程

免责声明:转载请注明出处:http://jing-feng.com.cn/news/323048.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!