1.备份原yum源文件
mv /etc/yum.repos.d/CentOS- Base.repo /etc/yum.repos.d/CentOS- Base.repo.backup
2.下载阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.清除缓存&&更新缓存
yum clean all 清除缓存
yum makecache 更新缓存
mv /etc/yum.repos.d/CentOS- Base.repo /etc/yum.repos.d/CentOS- Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all 清除缓存
yum makecache 更新缓存