替换yum源
阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/
1、备份原镜像文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
2、下载CentOS-Base.repo
curl http://mirrors.aliyun.com/repo/Centos-7.repo > /etc/yum.repos.d/CentOS-Base.repo
3、清除和生成缓存
yum clean all
yum makecache
4、更新系统
yum -y update
常见问题:
一:遇到镜像无法下载的时候
Error Downloading Packages:
openssl-devel-1.0.1e-16.el6_5.14.i686:failure: Packages/openssl-devel-1.0.1e-16