centos7 更换repo源为阿里
更换repo源为阿里
#安装wget 已安装可以略过
yum install -y wget
# 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
# 下载新的CentOS-Base.repo到/etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 清理并生成缓存
yum clean cache && yum makecache