- 备份自带的YUM源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
- 运行 yum makecache 生成缓存
yum makecache
- 查看更换的阿里云镜像的仓库是否生效。
yum clean all
yum repolist