yum报错:failure: repodata/repomd.xml from xxxxxx: [Errno 256] No more mirrors to try.解决办法
问题截图:
解决步骤:
1.删除老仓库
rm -rf /etc/yum.repos.d/*
2.卸载yum包
先查询已安装版本
rpm -qa yum
卸载
rpm -qa yum yum-3.4.3-150.el7.centos.noarch
卸载组件
rpm -qa | grep yum | xargs rpm -e --nodeps
在查询没有了
rpm -qa yum
3.下载最新的rpm包
下载地址:
http://mirrors.163.com/centos/7/os/x86_64/Packages/
下载这三个:
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
4.重新安装yum
rpm -qa yum
5.导入证书
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
如果提示网络连接失败,可自行下载,然后从路径导入
6.设置阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
7.清除缓存,生成新的缓存
yum clean all
yum makecache
等待命令完成,在重写安装即可
版权声明:本文为zy517863543原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。