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

当前位置:首页 - Linux系统 - centos - 正文

君子好学,自强不息!

centos系统下yum安装失败怎么办?

2022-06-18 | centos | 1818ip | 266°c
A+ A-

一、检验是否可以上网

ping www.baidu.com

二、如果不能上网:

1、cd到 /etc/sysconfig/network-scripts/

cd /etc/sysconfig/network-scripts/

2、ls找到 ifcfg-****(星号部分是随机的) 用vi打开

3、将ONBOOT=no 改为 yes

4、:wq保存并退出

5、重启网络服务

service network restart

三、如果可以联网,但yum install links(例)安装失败。原因是速度太慢,更换镜像源即可。如下:

1、备份你的原镜像文件,以免出错后可以恢复。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

如果找不到原有的,就直接用新的源。

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、运行yum makecache生成缓存


本文来源:1818IP

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

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

发表评论

必填

选填

选填

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