一笆制、[endif]為啥centos8要換源?
當(dāng)前時(shí)間是2022年2月22號
2021年12月31日CentOS 8操作系統(tǒng)版本結(jié)束了生命周期(EOL)涣达,Linux社區(qū)已不再維護(hù)該操作系統(tǒng)版本在辆。后續(xù)新的服務(wù)器建議使用CentOS Stream证薇,或者其他linux版本,按照社區(qū)規(guī)則匆篓,CentOS 8的源地址http://mirror.centos.org/centos/8/內(nèi)容已移除浑度,目前第三方的鏡像站中均已移除CentOS 8的源。但是對于業(yè)務(wù)過渡期仍然需要使用centos8鸦概,并且在上面安裝軟件箩张,那我們需要更新備用源,之前第三方的源都是同步centos官方的窗市,并隨之更新先慷,官方的源去掉后,第三方也就無法同步到了咨察,所以第三方的源也就不復(fù)存在了论熙,但是大部分第三方都把最后的源做了個(gè)備份弄了個(gè)新的地址,方便過渡期使用摄狱。當(dāng)然切換到阿里云的源速度也會更快些脓诡。
阿里云鏡像站官網(wǎng):https://developer.aliyun.com/mirror/
阿里云centos源地址:https://developer.aliyun.com/mirror/centos
二、[endif]如何更換centos8源的阿里云鏡像地址
兩種情況二蓝,阿里云ecs和非阿里云ecs誉券,非阿里云ecs要求可以連接上公網(wǎng)指厌,如果是阿里云ecs使用阿里云提供的內(nèi)網(wǎng)鏈接源刊愚,不是阿里云的服務(wù)器,使用的公網(wǎng)源踩验,肯定內(nèi)網(wǎng)源的速度會更快些鸥诽。
仔細(xì)觀察就能發(fā)現(xiàn)內(nèi)網(wǎng)鏈接:mirrors.cloud.aliyuncs.com
公網(wǎng)鏈接:mirrors.aliyun.com
非阿里云服務(wù)器用戶:
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/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache
阿里云服務(wù)器用戶:
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/repo/Centos-vault-8.5.2111.repo
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
三、[endif]其他工具換源
推薦使用linux一鍵換源腳本箕憾,https://supermanito.github.io/LinuxMirrors/#/
不僅支持centos牡借,還支持其他linux發(fā)行版本,感謝原作者的無私奉獻(xiàn)袭异。