CentOS 8 EOL如何切换源?

一、为啥centos8要换源?
当前时间是2022年2月22号
2021年12月31日CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。后续新的服务器建议使用CentOS Stream,或者其他linux版本,按照社区规则,CentOS 8的源地址http://mirror.centos.org/cent...内容已移除,目前第三方的镜像站中均已移除CentOS 8的源。但是对于业务过渡期仍然需要使用centos8,并且在上面安装软件,那我们需要更新备用源,之前第三方的源都是同步centos官方的,并随之更新,官方的源去掉后,第三方也就无法同步到了,所以第三方的源也就不复存在了,但是大部分第三方都把最后的源做了个备份弄了个新的地址,方便过渡期使用。当然切换到阿里云的源速度也会更快些。

阿里云镜像站官网:https://developer.aliyun.com/...
阿里云centos源地址:https://developer.aliyun.com/...

二、如何更换centos8源的阿里云镜像地址
两种情况,阿里云ecs和非阿里云ecs,非阿里云ecs要求可以连接上公网,如果是阿里云ecs使用阿里云提供的内网链接源,不是阿里云的服务器,使用的公网源,肯定内网源的速度会更快些。
仔细观察就能发现内网链接:mirrors.cloud.aliyuncs.com
公网链接:mirrors.aliyun.com
非阿里云服务器用户:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/re...
yum clean all && yum makecache
阿里云服务器用户:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/re...
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache
三、其他工具换源
推荐使用linux一键换源脚本,https://supermanito.github.io...
不仅支持centos,还支持其他linux发行版本,感谢原作者的无私奉献。
Gitee地址:https://gitee.com/SuperManito...

以上是 CentOS 8 EOL如何切换源? 的全部内容, 来源链接: utcz.com/z/267503.html

回到顶部