CentOS 6操作系統(tǒng)版本結(jié)束了生命周期(EOL),Linux社區(qū)已不再維護(hù)該操作系統(tǒng)版本。建議您升級(jí)操作系統(tǒng)至CentOS 7及以上,如果您的業(yè)務(wù)過渡期仍需要使用CentOS 6系統(tǒng)中的一些安裝包,請(qǐng)根據(jù)下文切換CentOS 6的源。
背景信息
2020年11月30日CentOS 6 EOL。按照社區(qū)規(guī)則,CentOS 6的源地址http://mirror.centos.org/centos-6/內(nèi)容已移除,目前第三方的鏡像站中均已移除CentOS 6的源。阿里云的源http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com也無法同步到CentOS 6的源。當(dāng)您在阿里云上繼續(xù)使用默認(rèn)配置的CentOS 6的源會(huì)發(fā)生報(bào)錯(cuò)。報(bào)錯(cuò)示例如下圖所示:
您可以通過下文的操作步驟,在CentOS 6操作系統(tǒng)的ECS實(shí)例中將源配置按照網(wǎng)絡(luò)環(huán)境不同進(jìn)行切換。
- yum源
專有網(wǎng)絡(luò)VPC類型實(shí)例需切換為http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/源。
經(jīng)典網(wǎng)絡(luò)類型實(shí)例需切換為http://mirrors.aliyuncs.com/centos-vault/6.10/源。 - epel源
專有網(wǎng)絡(luò)VPC類型實(shí)例需切換為http://mirrors.cloud.aliyuncs.com/epel-archive/6/源。
經(jīng)典網(wǎng)絡(luò)類型實(shí)例需切換為http://mirrors.aliyuncs.com/epel-archive/6/源。
操作步驟
服務(wù)器編輯/etc/yum.repos.d/CentOS-Base.repo 文件。
[base]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-6.10
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.cloud.aliyuncs.com/centos-vault/RPM-GPG-KEY-CentOS-6
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
baseurl=http://mirrors.cloud.aliyuncs.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.cloud.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6
切換完成后,您可以使用yum install命令安裝需要的軟件包。
