1 将系统yum源备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2 下载阿里的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3 生成缓存
yum makecache
4 更新(可选)
yum update
备注:有些公司有网络的限制,将/etc/yum.repos.d/CentOS-Base.repo文件中的http全部改为https可能会有惊喜。