更换yum源为阿里云源
-
切换到/etc/yum.repos.d/目录下
cd /etc/yum.repos.d
-
(推荐)备份原有yum源文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
-
下载阿里云yum源
wget -O /etc//yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo CentOS-7.repo
(以Centos7为例) -
清理yum缓存
yum clean all
-
生成新的yum缓存
yum makecache