首页 > 系统相关 >AlmaLinux yum/dnf repo/mirrors 国内镜像列表及更换方法

AlmaLinux yum/dnf repo/mirrors 国内镜像列表及更换方法

时间:2024-06-19 14:32:31浏览次数:13  
标签:dnf mirrors AlmaLinux baseurl repo almalinux https

AlmaLinux yum/dnf repo/mirrors 国内镜像列表及更换方法

AlmaLinux Mirrors

请访问原文链接:https://sysin.org/blog/rocky-linux-mirrors/,查看最新版。原创作品,转载请保留出处。

作者主页:sysin.org


almalinux-logo

高校镜像推荐 mirror.sjtu.edu.cnmirrors.zju.edu.cn
商业公司镜像推荐 mirrors.aliyun.com
其他多数镜像不全,要么没有 almalinux,要么没有 rocky。
当然可以根据个人喜好、地理位置、访问体验等因素来选择。

AlmaLinux

该项配置方法兼容 AlmaLinux 8 和 9。

AlmaLinux 9 默认 repo 如下:

[root@localhost ~]# dnf repolist
repo id                                               repo name
appstream                                             AlmaLinux 9 - AppStream
baseos                                                AlmaLinux 9 - BaseOS
extras                                                AlmaLinux 9 - Extras
# 安装 epel 后增加
epel                                                  Extra Packages for Enterprise Linux 9 - x86_64

# 文件列表如下
[root@localhost ~]# ll /etc/yum.repos.d/
almalinux-appstream.repo
almalinux-baseos.repo
almalinux-crb.repo
almalinux-extras.repo
almalinux-highavailability.repo
almalinux-nfv.repo
almalinux-plus.repo
almalinux-resilientstorage.repo
almalinux-rt.repo
almalinux-sap.repo
almalinux-saphana.repo
epel-testing.repo
epel.repo

官方镜像列表

官方列表:https://mirrors.almalinux.org/,CN 开头的站点。

例如:

Name Sponsor Status Continent Region FTP HTTP HTTPS RSYNC IPv6
mirrors.aliyun.com Alibaba Cloud Computing Co.,Ltd. ok Asia CN Mirror Mirror
mirror.sjtu.edu.cn Shanghai Jiao Tong University Network Information Center expired AS CN Mirror

基本系统

AlmaLinux 国内镜像源更换方法如下。

阿里云示例(本次模板使用):

# 配置
# 注意:“# baseurl” 中间有个空格(AlmaLinux 专有)
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

# 恢复 (sysin)
sed -e 's|^#mirrorlist=|mirrorlist=|g' \
    -e 's|^baseurl=https://mirrors.aliyun.com|# baseurl=https://repo.almalinux.org|g' \
    -i.bak \
    /etc/yum.repos.d/almalinux*.repo

上海交通大学示例(mirror 没有 s):

mirror.sjtu.edu.cn` = `mirrors.sjtug.sjtu.edu.cn
# 配置
# 注意:“# baseurl” 中间有个空格(AlmaLinux 专有)
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
    -e 's|^# baseurl=https://repo.almalinux.org|baseurl=https://mirror.sjtu.edu.cn|g' \
    -i.bak \
    /etc/yum.repos.d/almalinux*.repo

# 恢复 (sysin)
sed -e 's|^#mirrorlist=|mirrorlist=|g' \
    -e 's|^baseurl=https://mirror.sjtu.edu.cn|# baseurl=https://repo.almalinux.org|g' \
    -i.bak \
    /etc/yum.repos.d/almalinux*.repo

更换其他镜像,对应按照上面替换 Mirror Name 即可。

例如:

EPEL

若安装了 epel,同时修改如下:

阿里云 epel 示例:

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
# 注意 (sysin):
# CentOS 8、AlmaLinux 9 与 Rocky Linux 8/9 中 #baseurl=https://download.example/pub
# 而 AlmaLinux 8 早期版本是:#baseurl=https://download.fedoraproject.org/pub
# 故增加一句上述地址的替换

# 恢复
sed -e 's|^#metalink=|metalink=|g' \
    -e 's|^baseurl=https://mirrors.aliyun.com|#baseurl=https://download.example/pub|g' \
    -i.bak \
    /etc/yum.repos.d/epel*.repo

上海交通大学 epel 示例:

# 注意 (sysin):上海交通大学地址多一个 fedora
sed -e 's|^metalink=|#metalink=|g' \
    -e 's|^#baseurl=https://download.example/pub|baseurl=https://mirror.sjtu.edu.cn/fedora|g' \
    -e 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirror.sjtu.edu.cn/fedora|g' \
    -i.bak \
    /etc/yum.repos.d/epel*.repo
# 注意 (sysin):
# CentOS 8、AlmaLinux 9 与 Rocky Linux 8/9 中 #baseurl=https://download.example/pub
# 而 AlmaLinux 8 早期版本是:#baseurl=https://download.fedoraproject.org/pub
# 故增加一句上述地址的替换

# 恢复
sed -e 's|^#metalink=|metalink=|g' \
    -e 's|^baseurl=https://mirror.sjtu.edu.cn/fedora|#baseurl=https://download.example/pub|g' \
    -i.bak \
    /etc/yum.repos.d/epel*.repo

其他替换地址如:

清理并重新生成软件包信息缓存

# 备注:yum=dnf
yum clean all
rm -rf /var/cache/yum
yum makecache
#yum autoremove #此命令需要已经 makecache

相关产品:

标签:dnf,mirrors,AlmaLinux,baseurl,repo,almalinux,https
From: https://www.cnblogs.com/sysin/p/18256193

相关文章

  • DNF单机源码架设教程|无需服务器|虚拟机一键搭建
    一.搭建所需要的文件获取地址:https://githubs.xyz/boot/?app=15二.搭建步骤只需一台windows系统,首先需要安装vm虚拟机目录在vm虚拟机下面安装完成打开需要输入激活序列号,在VM序列号.txt里面,16.0的左上角文件打开选择:服务端->DNFServer7.9x64.vmx打开左上角......
  • AlmaLinux 9 环境下部署 PostgreSQL 16 服务
    #将SELinux设置为宽容模式sudosetenforcePermissivesudovi/etc/selinux/configSELINUX=permissive#关闭系统防火墙服务sudosystemctlstopfirewalld.servicesudosystemctldisablefirewalld.service#安装PostgreSQL16服务sudoyuminstall-yhttps:/......
  • 解决DNF游戏启动故障:缺少ClientBase.dll文件的高效应对策略
    《地下城与勇士》(DNF)是一款风靡全球的2D横版卷轴式大型多人在线角色扮演游戏,以其街机风格的爽快打击感、丰富多样的职业体系、深渊副本挑战、PVP竞技场以及装备打造系统著称,引领玩家在阿拉德大陆展开惊心动魄的冒险之旅。当遇到DNF(地下城与勇士)游戏在启动时提示缺少ClientBase.......
  • dnf数据库备份&迁移
    使用mysql自带的mysqldump备份mysqldump-ugame-p--databasesd_channeld_guildd_taiwand_taiwan_secud_technical_reporttaiwan_billingtaiwan_caintaiwan_cain_2ndtaiwan_cain_auction_cerataiwan_cain_auction_goldtaiwan_cain_logtaiwan_cain_webtaiwan_game_e......
  • 问microdnf update命令安装新包,而不仅仅是更新现有的包。
    我的Dockerfile使用基本映像registry.access.redhat.com/ubi8/ubi-minimal,它有microdnf包管理器。当我在docker文件中包含以下代码片段以获得现有包的最新更新时,代码语言:javascript复制RUNtrue\&&microdnfcleanall\&&microdnfupdate--nodocs\......
  • Arch Linux CN Community repo mirrors list
    kate /etc/pacman.conf/etc/pacman.d/mirrorlist ##Ourmainserver(Amsterdam,theNetherlands)(ipv4,ipv6,http,https)[archlinuxcn]Server=https://repo.archlinuxcn.org/$arch ##CERNET(中国)(ipv4,ipv6,http,https)##Added:2023-08-19##Thiswill......
  • 如何在AlmaLinux服务器中安装 VirtualBox 7.0
    https://www.a5idc.net/helpview_1331.html目前由Oracle拥有和维护的OracleVMVirtualBox是世界上最受欢迎的开源虚拟化平台,它使用户能够从底层计算机硬件创建虚拟机。VirtualBox是第2类管理程序,这意味着它安装在现有操作系统(如Windows或Linux)之上,以创建模拟CPU、RAM......
  • AlmaLinux 9.4 正式版发布 - RHEL 二进制兼容免费发行版
    AlmaLinux9.4正式版发布-RHEL二进制兼容免费发行版由社区提供的免费Linux操作系统,RHEL二进制兼容发行版请访问原文链接:AlmaLinux9.4正式版发布-RHEL二进制兼容免费发行版,查看最新版。原创作品,转载请保留出处。作者主页:sysin.org由社区提供的免费Linux操作系......
  • AlmaLinux 9.3 x86_64 OVF (sysin) - VMware 虚拟机模板
    AlmaLinux9.3x86_64OVF(sysin)-VMware虚拟机模板由社区提供的免费Linux操作系统,RHEL二进制兼容发行版。请访问原文链接:AlmaLinux9x86_64OVF(sysin)-VMware虚拟机模板,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgAlmaLinuxrelease9.3(Shamroc......
  • Nessus 10.7 Auto Installer for RHEL 9/AlmaLinux 9/Rocky Linux 9 (updated Apr 202
    Nessus10.7AutoInstallerforRHEL9/AlmaLinux9/RockyLinux9(updatedApr2024)发布Nessus试用版自动化安装程序,支持macOSSonoma、RHEL9和Ubuntu22.04请访问原文链接:https://sysin.org/blog/nessus-auto-install-for-rhel-9/,查看最新版。原创作品,转载请保留出处......