CentOS6.x官方停止维护后yum源更新设置
一台老的机器在执行yum install ftp 时,报错如下:
# yum install ftp
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
http://mirrors.163.com/centos/6.9/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
yum不能更新原因:
CentOS6已经随着2020年11月的结束进入了EOL(Reaches End of Life), 在2020年12 CentOS官方停止了对CentOS 6的所有更新,并且下架了包括官方所有的CentOS6源,目前阿里、腾讯、163、清华等CentOS6源已无法使用。
以下官方redme文档的解释:
This directory (and version of CentOS) is deprecated. Please see this FAQ concerning the CentOS release scheme:
https://wiki.centos.org/FAQ/General
Please keep in mind that 6.0, 6.1, 6.2, 6.3, 6.4 , 6.5, 6.6, 6.7, 6.8 , 6.9 and 6.10 no longer get any updates, nor any security fix’s. The whole CentOS 6 is dead and shouldn’t be used anywhere at all
CentoS 6 停止维护更新日期2020年11月30日
CentOS 7 停止维护更新日期2024年6月30日
CentOS 8 停止维护更新日期2029年5月31日
官方地址:https://wiki.centos.org/About/Product
解决方法如下:
官方也提供了低版本的镜像源,更新下即可正常安装:
CentOS官方:http://vault.centos.org/
国内也有对应的镜像源:http://mirrors.cloud.tencent.com/centos-vault/
https://mirrors.aliyun.com/centos-vault/
https://mirrors.tuna.tsinghua.edu.cn/centos-vault/
等等。
将/etc/yum.repos.d/CentOS-Base.repo中的mirrorlist注释掉,将$releasever替换为6.0,将mirror.centos.org/centos替换为国内镜像站mirrors.aliyun.com/centos-vault 即可正常更新,修改完后的文件如下
[base]
name=CentOS-6.0 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=6.0&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirrors.aliyun.com/centos-vault/6.0/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.0 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=6.0&arch=$basearch&repo=updates&infra=$infra
baseurl=http://mirrors.aliyun.com/centos-vault/6.0/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6.0 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=6.0&arch=$basearch&repo=extras&infra=$infra
baseurl=http://mirrors.aliyun.com/centos-vault/6.0/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.0 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=6.0&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://mirrors.aliyun.com/centos-vault/6.0/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.0 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=6.0&arch=$basearch&repo=contrib&infra=$infra
baseurl=http://mirrors.aliyun.com/centos-vault/6.0/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
最后执行:
yum clean all #清理
yum install ftp #安装软件
Tag标签:「yum update 更新」更新时间:「2021-11-04 16:44:54」阅读次数:「8480」