1.修改/etc/yum.repos.d/CentOS-Base.repo文件
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
2.修改/etc/yum.repos.d/CentOS-AppStream.repo文件
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
3。修改/etc/yum.repos.d/CentOS-Extras.repo文件
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
4.清楚缓存
# 清除所有缓存文件
yum clean all
# 制作元数据缓存
yum makecache