- RockyLinux设置国内镜像
# 设置镜像变量 MIRROR=mirrors.aliyun.com/rockylinux # 执行替换 sudo sed -i.bak \ -e "s|^mirrorlist=|#mirrorlist=|" \ -e "s|^#baseurl=|baseurl=|" \ -e "s|dl.rockylinux.org/\$contentdir|$MIRROR|" \ /etc/yum.repos.d/Rocky-*.repo
# 生成缓存 sudo dnf makecache
- almalinux设置国内镜像
sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^# baseurl=https://repo.almalinux.org|baseurl=https://mirrors.aliyun.com|g' \ -i.bak \ /etc/yum.repos.d/almalinux*.repo
# 生成缓存 dnf makecache