当前位置:首页 » 《我的小黑屋》 » 正文

yum update 更新报错,在使用yum时failed

22 人参与  2024年09月26日 14:40  分类 : 《我的小黑屋》  评论

点击全文阅读


错误信息如下:

解决方案:

1、检查机器是否链接外网

ping www.baidu.com

 2、查看防火墙状态,并暂时关闭防火墙。

systemctl status firewalld
systemctl stop firewalld

 

3、备份当前yum源

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

4、安装新的yum源(下载国内yum源配置文件到/etc/yum.repos.d/CentOS-Base.repo)

阿里云 CentOS 7 源(推荐):

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

网易163 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

搜狐 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS7-Base-sohu.repo

华为云 CentOS 7 源:

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

华东理工大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64

清华大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/

北京理工大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.bfsu.edu.cn/centos/7/os/x86_64/

上海交通大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://ftp.sjtu.edu.cn/centos/7/os/x86_64/

中国科学技术大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64/

兰州大学 CentOS 7 源:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirror.lzu.edu.cn/centos/7/os/x86_64/

5、以阿里云源为例:

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

 6、清理老版本yum源,并更新新的yum源

yum clean all
yum makecache

 

 

至此-以上完成yum源转换,并解决了yum无法使用。

 


点击全文阅读


本文链接:http://zhangshiyu.com/post/164887.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

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

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1