This shared guide is currently available only in Chinese. Use the controls below to select the mirror endpoint and command options.

General options

对于 Rocky Linux 8,使用以下命令替换默认的配置

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.zju.edu.cn/rocky|g' \
         -i.bak \
         /etc/yum.repos.d/Rocky-*.repo

对于 Rocky Linux 9 及以上版本,使用以下命令替换默认的配置

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.zju.edu.cn/rocky|g' \
         -i.bak \
         /etc/yum.repos.d/rocky*.repo

以上命令只替换了默认启用的仓库。替换之后请运行 dnf makecache 更新缓存。

Guide content comes from ZJUSCT/mirrorz-docs@de87bf043f31 under CC BY-NC-SA 4.0.