信息发布→ 登录 注册 退出

centos yum无法使用怎么解决

发布时间:2020-03-25

点击量:

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

标签:# centos  # 断网  # 镜像  # 报了  # 则说  # 没有了  # enabled  # cached  # speeds  # mirror  # hostfile  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!