最近在CentOS 6上安装软件一直报错,安装不了,换了163,清华,阿里yum源都不行,进去链接看才发现有关CentOS 6 yum源包全部下架了。

一、 官宣:CentOS 6停止所有更新

​​​​在这里插入图片描述
CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life)。所以在2020年12月2日,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

所以,各位在企业生产中有用到相关的版本时,需要在这些时间节点注意下切换、升级。否则可能就出现如下错误

# yum install lszrz
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.

因此,目前在CentOS6系统上执行Yum命令时会提示上图的404错误。

如果,还有部分系统没有来的及升级、切换的,或者由于一些原因还要继续使用CentOS6的话,肯定还是有解决方法的。

可以使用vault.centos.org作为更新源!!!

  • CentOS官方:http://vault.centos.org/
  • 阿里云镜像:http://mirrors.aliyun.com/centos-vault/

二、解决方案

1、关闭fastestmirror

# vi /etc/yum/pluginconf.d/fastestmirror.conf
#修改参数
enable=0
......

2、将原来的源改名,养成良好的备份习惯

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

3、更换源

#替换为官方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

#替换为阿里云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-Aliyun.repo

如果系统无wget命令,无法下载文件时,可以使用上的面地址中的内容,直接编辑原来的Yum源文件互替换即可。

时代的更新发展,科技的进步,无论是什么样的软件,都会有退出历史舞台的一天。这就是万物生存的法则,更新迭代,或者被时代所淘汰。

三、建议

最后,还是建议大家尽可能的升级到新的版本,虽然,上面的操作能够使用相关的功能,但随着官方对此版本的不再维护、更新,可能也是预示着未来会存在一定的漏洞风险。因此,除非有必要,否则尽量升级到新版本。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐