CentOS 8 結束生命週期(EOL)如何切換源

首頁 > 技術

CentOS 8 結束生命週期(EOL)如何切換源

來源:匿名 釋出時間:2022-03-07 15:31

CentOS 8作業系統版本結束了生命週期(EOL),Linux社群已不再維護該作業系統版本。建議切換到Anolis或Alinux。

背景資訊

2021年12月31日CentOS 8 EOL。按照社群規則,CentOS 8的源地址http://mirror.centos.org/centos/8/內容已移除,目前第三方的映象站中均已移除CentOS 8的源。阿里雲的http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com也無法同步到CentOS 8的源。繼續使用預設配置的CentOS 8的源會發生報錯。可以透過下文的操作步驟進行切換:

登入CentOS 8系統的ECS例項。具體操作,請參見連線方式概述。

執行以下命令備份之前的repo檔案。

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo

執行以下命令下載最新的repo檔案。

wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo

執行以下命令替換repo檔案中的連結。

sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo

執行以下命令重新建立快取。

yum clean all && yum makecache

yum源和epel源切換完成後,即可使用yum install命令在例項上安裝您所需要的軟體包。


上一篇:明明比四代機... 下一篇:杜淳老婆再被...
猜你喜歡
熱門閱讀
同類推薦