关于近期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

 

上一篇:citySearcher.py


下一篇:SpringMVC编程:初始化项目部署后,主页404代码问题解决