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/...centos

相關文章
相關標籤/搜索