天天看点

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.centos6 yum失败!

具体在使用yum安装wget的时候,报了如下的错误

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.centos6 yum失败!

 原因:centos6的默认源在2012年-12月左右被官方搞掉了

第一种方法:一键修复(一条一条执行即可):

一般执行了前3条命令就好了

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo 
yum clean all
yum makecache      

第二种方法:手动修复教程:

首先把fastestmirrors关了

vi /etc/yum/pluginconf.d/fastestmirror.conf      

 ​

​enable=0​

先把之前的repo挪到备份,然后下面两个二选一

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak      
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Official.repo      
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo      

继续阅读