1 备份原文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
2 下载阿里base基础源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3 更新base基础缓存
yum clean all
yum makecache
yum -y update
4 下载阿里epel拓展源
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
5 更新epel拓展缓存
yum clean all # 清除系统所有的yum缓存 yum makecache # 生成yum缓存 yum -y update