【笔记】更换CentOS镜像源

前言

更换 CentOS 7 镜像源

备份

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

换源

阿里巴巴

1
2
yum-config-manager --add-repo https://mirrors.aliyun.com/repo/Centos-7.repo
mv -f /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo

网易

1
2
yum-config-manager --add-repo https://mirrors.163.com/.help/CentOS7-Base-163.repo
mv -f /etc/yum.repos.d/CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo

更新软件源

  • 生成缓存
1
2
yum clean all
yum makecache
  • 更新
1
yum -y update

完成

参考文献

CSDN——inslow
间书——Happy_Hung