Introduction
Rocky Linux is a fork of CentOS that is downstream of Red Hat Enterprise Linux (RHEL). Like CentOS, it offers a stable version of Linux that is great for servers. It is intended as a fully compatible replacement for CentOS.
Execute the following command to replace
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \
-i.bak \
/etc/yum.repos.d/rocky-*.repo
dnf makecache
Then the replacement is done