1、切换到yum.repos.d目录下
cd /etc/yum.repos.d/
2、对CentOS-Base.repo进行备份(可省略)
mv CentOS-Base.repo CentOS-Base.repo.back
3、更换源
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、生成缓存
yum makecache
1、切换到yum.repos.d目录下
cd /etc/yum.repos.d/
2、对CentOS-Base.repo进行备份(可省略)
mv CentOS-Base.repo CentOS-Base.repo.back
3、更换源
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、生成缓存
yum makecache