1. 备份原文件和修改插件的配置文件
cp /etc/yum/pluginconf.d/fastestmirror.conf /etc/yum/pluginconf.d/fastestmirror.conf.bak
vi /etc/yum/pluginconf.d/fastestmirror.conf
# enabled = 1 //由1改为0,禁用该插件
cp /etc/yum.conf /etc/yum.conf.bak
vi /etc/yum.conf
# plugins=1 //改为0,不使用插件
2. 获取阿里云 repo
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
友情提示 wget 命令安装
yum -y install wget
3.rebuild yum cache
yum clean all
yum makecache