云计算百科
云计算领域专业知识百科平台

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

错误信息如下:

解决方案:

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无法使用。

     

    赞(0)
    未经允许不得转载:网硕互联帮助中心 » yum update 更新报错,在使用yum时failed
    分享到: 更多 (0)

    评论 抢沙发

    评论前必须登录!