Featured image of post CentOS 8 EOL导致更新源失败

CentOS 8 EOL导致更新源失败

再见,CentOS 8

封面PID=97289746

问题

这两天在自己服务器上安东西的时候突然发现CentOS 8的源更新报错了。

一下给我整懵了,记得上次update还是上次,没遇到这问题啊。第一反应是去看看源文件是不是出了什么岔子。

然而实际上源文件的源url也是正常的,这就奇怪了,同时也检查了下域名解析的dns,一切正常。这个时候基本可以排除本地问题的可能性了,那还有可能就是官方的源出了什么问题了。

原因

之后去官网一看才想起来,CentOS 8之前已经宣布在2021年年底放弃维护了,因此他的官方源也已经失效了…

原文链接

CentOS Linux 8 will reach End Of Life (EOL) on December 31st, 2021.
This content will be removed from our mirrors, and moved to vault.centos.org where it will be archived permanently, since we will not be able to provide updates to the content after the EOL date.

解决方法

根据通知原文描述,我们可以使用官方的归档源,官方归档域名是vault.centos.org,只需要把源文件的域名换成归档域名就行了。

1
2
3
# 在shell中使用sed直接修改所有源的域名
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

搞定

但是官方论坛的版主还是建议尽快更换系统分支,因为更换归档源并不能解决根本问题,CentOS8后续不再维护才是真正的问题。

No. Problem NOT solved. That just switches the repos to vault.centos.org but CentOS 8 is dead and will not receive any more updates. Your solution does not handle that.
You need to switch to a different distro, not just point to vault which is already stale and out of date.

顺带一提,CentOS 7将在2024年结束维护,以后再也没有免费的CentOS给我们用了,CentOS也要成时泪了。

运维
Licensed under CC BY-NC-SA 4.0