首先关闭官方的fastmirrors关了
vi /etc/yum/pluginconf.d/fastestmirror.conf
修改
enable=0
或者执行以下命令
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
把之前的repo挪到备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
替换为阿里云vault镜像(国内服务器用)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://tools.guo.work/linux/centos6yum/Centos-6-Vault-Aliyun.repo
替换为官方vault源(国外服务器用)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://tools.guo.work/linux/centos6yum/Centos-6-Vault-Official.repo
最后为了检测这一次yum的源是否是成功的,使用下面的命令来进行测试
yum grouplist