配置DNS
cat >> /etc/resolv.conf <<EOF
nameserver 8.8.8.8
nameserver 114.114.114.114
EOF
# 验证是否可联网
ping www.baidu.com
查看原有的yum源
cd /etc/yum.repos.d/
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
如果之前没有替换过,直接下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
清除缓存,生成缓存
yum clean all
yum makecache