官方镜像列表,下拉查找
官方镜像列表:https://mirrors.rockylinux.org/mirrormanager/mirrors CN 开头的站点。
一键更改镜像地址脚本
cat <<'EOF'>>/RackyLinux_Update_repo.sh
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: make.han
# Date: 2024/06/18
# Rocky Linux yum dnf update repo/mirrors
echo "Update the base system repo"
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/[Rr]ocky*.repo
echo "Update epel repo"
sed -e 's|^metalink=|#metalink=|g' \
-e 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|g' \
-i.bak \
/etc/yum.repos.d/epel{,-testing}.repo
echo "disable cisco-openh264 repo"
yum -y install yum-utils
sed -i 's|^metalink=.*|#&|' /etc/yum.repos.d/epel-cisco-openh264.repo
sed -i 's/enabled=.*/enabled=0/g' /etc/yum.repos.d/epel-cisco-openh264.repo
echo "Refresh cache"
yum clean all
rm -rf /var/cache/yum
yum makecache
EOF
echo "Run Script"
bash /RackyLinux_Update_repo.sh