1、备份现有源
cd /etc/yum.repos.d/
mkdir backup
mv *.repo ./backup
2、下载阿里云源文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
3、检查以下是否成功
cat /etc/yum.repos.d/CentOS-Base.repo
4、生成缓存
yum makecache