centos7更换镜像源

1、下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/ 。

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2、更新镜像源。

yum clean all

生成缓存

yum makecache