centos yum无法使用怎么解决


本文摘自PHP中文网,作者尚,侵删。

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

1

2

3

4

5

6

7

8

9

[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、检查是否断网

1

ping www.baidu.com

2、如果没断网,则说明是yum镜像没有了,需要下载一个:

1

2

3

4

5

6

7

8

9

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无法使用怎么解决的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

CentOS如何升级bash(修复破壳漏洞)

CentOS7查看docker是否安装的方法

CentOS下更改目录权限后仍不可写怎么办

怎么安装CentOS工具

CentOS复制时权限不够如何解决

CentOS怎么实现连接远程桌面

CentOS系统中文文件名乱码

CentOS 7 安装jdk1.7的实例教学

如何解决CentOS找不到ifcfg配置文件

如何解决CentOS下sudo命令找不到

更多相关阅读请进入《CentOS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...