CentOS 8的Yum更新方法

系統設定

CentOS 8的Yum更新方法

2024-08-03 22:56


                                            




由於CentOS 8.0Stream已經停止更新,你需要自己更新yum:

 

1.將原始檔備份

cd /etc/yum.repos.d/ && mkdir backup && mv *repo backup/
2、下載阿里源檔

curl -o /etc/yum.repos.d/CentOS-Base.repo http: //mirrors.aliyun.com/repo/Centos-8.repo
3、更新來源裡面的位址

sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum .repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
4、產生快取

yum clean all && yum makecache