错误背景:
环境:虚拟机下的centos7
在执行以下两个命令更新yum仓库后,再更新yum缓存时,到中间就会执行更换别的镜像,最后出现错误:http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found,此时运行yum下的命令也是同样的错误
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O
/etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel.repo?spm=a2c6h.25603864.0.0.1d2f5969k7Mms3
解决方法:
先在虚拟机中保存快照(避免我的方法解决不了,还能恢复一下)
1.打开上面第二行代码中的文件
vim /etc/yum.repos.d/epel.repo
2.把数字6替换成7
:1,$s/6/7/g