centos7更换下载源

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
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.清理并生成新缓存

yum clean all
yum makecache

image-20210624153312888

原文地址:https://www.cnblogs.com/huny/p/14927748.html