centos7下更换 yum 源为阿里源
备份旧的配置文件
cd /etc/yum.repos.d/ # 进入文件夹 mv CentOS-Base.repo CentOS-Base.repo_back # 备份原始配置文件
下载阿里源的文件
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # 若没有 wget 可使用 curl curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清理缓存
yum clean all
重新生成缓存
yum makecache
更新
yum -y update