查看centos版本
cat /etc/centos-release

下載新的CentOS.repo
根據自己的centos版本下載對應的,可在 https://mirrors.aliyun.com/repo/ 下查看已有aliyun已提供的版本。之前下載的 Centos-8.repo 后,仍會一直報各種安裝更新錯誤找不到源的情況,改為 Centos-vault-8.5.2111.repo ,問題就不存在了。
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
運行 yum makecache 生成緩存
yum makecache
參考地址:
https://blog.csdn.net/csdn2561/article/details/122902764
