官方镜像列表,下拉查找
- 官方镜像列表: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/mirrorsecho "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*.repoecho "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}.repoecho "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.repoecho "Refresh cache"
yum clean all
rm -rf /var/cache/yum
yum makecache
EOFecho "Run Script"
bash /RackyLinux_Update_repo.sh