CentOS更换yum源
1 以阿里云源为例
bash
# 测试阿里云源访问
ping mirrors.aliyun.com
# Centos7默认使用的CentOS-Base.repo文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载阿里云源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 清除yum缓存
yum clean all
# 缓存阿里云源
yum makecache
# 测试阿里云源
yum list