首页 > 运维 > CentOS > centos yum无法使用怎么解决

centos yum无法使用怎么解决

发布: 2020-03-25 16:47:58
原创
3437 人浏览过

centos 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 <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>
登录后复制

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视频教程

以上是centos yum无法使用怎么解决的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
centos下mysql启动报错
来自于 1970-01-01 08:00:00
0
0
0
centos7 - git的linux版本没有centos的?
来自于 1970-01-01 08:00:00
0
0
0
centos7 - centos 7,添加nginx为开机启动?
来自于 1970-01-01 08:00:00
0
0
0
为什么不是存放代码在linux的centos中
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板