官方镜像列表
- 官方列表:https://mirrors.almalinux.org/
- CN 开头的站点,不同区域查询即可
一键更改镜像地址脚本
cat <<'EOF'>>/AlmaLinux_Update_repo.sh
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: make.han
# Date: 2024/06/18
# AlmaLinux yum dnf update repo/mirrors
echo "Update the base system repo"
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^# baseurl=https://repo.almalinux.org|baseurl=https://mirrors.aliyun.com|g' \
-i.bak \
/etc/yum.repos.d/almalinux*.repo
echo "Update epel repo"
sed -e 's|^metalink=|#metalink=|g' \
-e 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|g' \
-e 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|g' \
-i.bak \
/etc/yum.repos.d/epel*.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 /AlmaLinux_Update_repo.sh