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

1次阅读

共计 397 个字符,预计需要花费 1 分钟才能阅读完成。

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/…

正文完
 0