Last active
March 27, 2024 06:44
-
-
Save akkuman/ecbaa3afde5e4e7cf440c09b3ca6067b to your computer and use it in GitHub Desktop.
rockylinux 9 (epel) 切换国内源
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -e 's|^mirrorlist=|#mirrorlist=|g' \ | |
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.sjtug.sjtu.edu.cn/rocky|g' \ | |
-i.bak \ | |
/etc/yum.repos.d/rocky*.repo && \ | |
dnf makecache && \ | |
dnf install -y 'dnf-command(config-manager)' && \ | |
dnf config-manager --enable devel && \ | |
yum install -y epel-release && \ | |
# https://github.com/tuna/issues/issues/1856 | |
# https://help.mirrors.cernet.edu.cn/epel/?mirror=SJTUG-Siyuan | |
sed -e 's|^metalink=|#metalink=|g' \ | |
-e 's|^#baseurl=|baseurl=|g' \ | |
-e 's|https\?://download\.fedoraproject\.org/pub/epel|https://mirrors.sjtug.sjtu.edu.cn/fedora/epel|g' \ | |
-e 's|https\?://download\.example/pub/epel|https://mirrors.sjtug.sjtu.edu.cn/fedora/epel|g' \ | |
-i /etc/yum.repos.d/epel{,-testing}.repo && \ | |
dnf makecache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment