一、备份现有yum源配置
cd /etc/yum.repos.d/
rename repo repo.old CentOS-*.repo
二、替换为其他yum源
1. 还原为官方源
rpm -Uvh --force http://mirror.centos.org/centos-7/7.9.2009/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm
2. 替换为腾讯云源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.rep
#执行以下命令替换为腾讯云内网源
sed -i 's+mirrors.cloud.tencent.com+mirrors.tencentyun.com+' /etc/yum.repos.d/CentOS-Base.repo