关于近期CentOS 6.X系列各大开源镜像站Yum源失效404问题解决

Posted 非著名运维

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于近期CentOS 6.X系列各大开源镜像站Yum源失效404问题解决相关的知识,希望对你有一定的参考价值。

CentOS停止维护时间:

 CentOS 6 停止维护更新日期2020年11月30日
 CentOS 7 停止维护更新日期2024年6月30日
 CentOS 8 停止维护更新日期2029年5月31日

可以看到CentOS 6.X系列在2020年11月30日后就停止维护了,目前国内各大开源镜像站都已经失效,但是以下一些还可以用。

解决方案:

1.关闭fastestmirror

sed -i "s/enabled=1/enabled=0/g" /etc/yum/pluginconf.d/fastestmirror.conf

2.备份原Yum源文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

3.更换Yum源

 3.1 阿里云Vault镜像

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo 
wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Aliyun.repo

 3.2 官方Vault源

wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Official.repo

4.清理并构建新缓存

yum clean all

yum makecache

yum repolist

repo具体内容-1:

[base]
name=CentOS-6 - Base
baseurl=http://mirrors.sohu.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#released updates
[update]
name=CentOS-6 - Updates
baseurl=http://mirrors.sohu.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#packages used/produced in the build but not released
[addons]
name=CentOS-6 - Addons
baseurl=http://mirrors.sohu.com/centos/6/addons/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras
baseurl=http://mirrors.sohu.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus
baseurl=http://mirrors.sohu.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib
baseurl=http://mirrors.sohu.com/centos/6/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#packages in testing
[testing]
name=CentOS-6 - Testing
baseurl=http://mirrors.sohu.com/centos/6/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.sohu.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

repo具体内容-2:

[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
  如果你觉得这篇文章还不错,就请动动你的发财手为本文留个言点个在看,或者转发一下吧,因为这将是我持续输出更多优质文章的最强动力

以上是关于关于近期CentOS 6.X系列各大开源镜像站Yum源失效404问题解决的主要内容,如果未能解决你的问题,请参考以下文章

Anaconda 恢复清华大学开源软件镜像,近期服务上线

阿里云镜像更改阿里巴巴开源镜像站镜像之——CentOS镜像

中国Linux开源镜像站大全

2017开源镜像站整合

使用阿里巴巴开源镜像站镜像——Kubernetes 镜像

CentOS 8 的安装(官方安装清华大学开源软件镜像站阿里云镜像网易镜像下的安装步骤)