具体在使用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

替换为官方Vault源

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

替换为阿里云Vault镜像

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

 

相关文章:

  • 2022-12-23
  • 2021-09-21
  • 2022-01-17
  • 2021-05-19
  • 2021-11-13
  • 2022-12-23
  • 2021-08-23
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案