乐趣区

关于linux:CentOS-更换-YUM-镜像源

1. 装置 wget
type wget
# 如果找不到 wget 命令,须要先装置
yum -y install wget
2. 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3. 下载
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# CentOS 8
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
4. 生成缓存
# 革除缓存
yum clean all
# 生成缓存,建设元数据
yum makecache

参考:https://developer.aliyun.com/…

退出移动版