執行yum makecache命令報錯
CentOS-8 - Base 7.1 B/s | 38 B 00:05
錯誤:為倉庫 'BaseOS' 下載元數據失敗 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
執行yum install gcc命令報錯
CentOS-8 - AppStream
錯誤:為倉庫 'AppStream' 下載元數據失敗 : Cannot prepare internal mirrorlist: No URLs in mirro
https://blog.csdn.net/qq_42209718/article/details/122876954
阿里鏡像站:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.74ab1b11JEvySJ
#備份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#下載新的base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
#生成huanc
yum makecache
結果