关于linux:CentOS-8-EOL如何切换源

4次阅读

共计 1357 个字符,预计需要花费 4 分钟才能阅读完成。

一、为啥 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…

正文完
 0