centos7更改国内源

1 备份源文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2 下载更改源

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

3 清空yum缓存并生存cache文件

yum clean all
yum makecache

4 尝试更新系统

yum -y update
点赞