1、安装wget
yum -y install wget
2、修改原yum源文件名称:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
3、下载阿里yum源或163都可以
163的yum源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
阿里yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、清楚缓存
yum makecache