CentOS 7 更换阿里云镜像源

1.备份默认源

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

2.更换源

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

或者

yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-7.repo

 

3.清除缓存

yum clean all

4.重新生成缓存

yum makecache

阿里云镜像源:

https://opsx.alibaba.com/mirror

你可能感兴趣的:(Linux)