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