先备份老源:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
CentOS7系统:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
具体方法参考阿里云官方:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11iDH0bA
刷新并生成缓存
yum clean all
yum makecache
查看仓库数量
yum repolist