Rocky Linux 更换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

相关推荐
大地的一角几秒前
(Linux)进程间通信
linux·运维·服务器
乾元1 分钟前
当奥本海默遇到图灵:AI 开启的网络安全新纪元
服务器·网络·人工智能·网络协议·安全·web安全
weixin_462446233 分钟前
【原创实践】在 CentOS 上安装 JupyterHub 并配置 R 语言支持 Kernel
linux·r语言·centos
cly19 分钟前
Jenkins重置管理员密码
运维·servlet·jenkins
零基础的修炼10 分钟前
Linux网络---UDP原理
linux·网络·udp
Flash.kkl7 小时前
Linux——进程信号
运维·服务器
苏宸啊8 小时前
Linux权限
linux·运维·服务器
Gofarlic_oms18 小时前
Windchill用户登录与模块访问失败问题排查与许可证诊断
大数据·运维·网络·数据库·人工智能
我是小疯子669 小时前
Python变量赋值陷阱:浅拷贝VS深拷贝
java·服务器·数据库
xqhoj9 小时前
Linux——make、makefile
linux·运维·服务器