Rocky Linux Yum源替换位上海交大镜像站点

Posted 白-胖-子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Rocky Linux Yum源替换位上海交大镜像站点相关的知识,希望对你有一定的参考价值。

  • 清华、华为、163等镜像站点还没有rocky源
  • 上海交大提供Rocky镜像站点
  • 替换Rocky自带源位上海交大yum源
sed -e 's|^mirrorlist=|#mirrorlist=|g' \\
    -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.sjtug.sjtu.edu.cn/rocky|g' \\
    -i.bak \\
    /etc/yum.repos.d/Rocky-*.repo

最后运行 dnf makecache 生成缓存

[root@C8-161 ~]# yum install -y yum-utils
Repository extras is listed more than once in the configuration
Rocky Linux 8 - Extras                 0.0  B/s |   0  B     00:02    
Errors during downloading metadata for repository 'extras':
  - Curl error (7): Couldn't connect to server for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=extras-8 []
  - Curl error (6): Couldn't resolve host name for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=extras-8 [Could not resolve host: mirrors.rockylinux.org]
Error: Failed to download metadata for repo 'extras': Cannot prepare internal mirrorlist: Curl error (7): Couldn't connect to server for https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=extras-8 []
[root@C8-161 ~]# sed -e 's|^mirrorlist=|#mirrorlist=|g' \\
>     -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.sjtug.sjtu.edu.cn/rocky|g' \\
>     -i.bak \\
>     /etc/yum.repos.d/Rocky-*.repo
[root@C8-161 ~]# dnf makecache
Repository extras is listed more than once in the configuration
Rocky Linux 8 - AppStream              373 kB/s | 7.8 MB     00:21    
Rocky Linux 8 - BaseOS                 594 kB/s | 3.5 MB     00:06    
Rocky Linux 8 - Extras                  11 kB/s | 3.8 kB     00:00    
BaseOS                                 503 kB/s | 3.6 MB     00:07    
AppStream                              412 kB/s | 8.1 MB     00:20    
EPEL                                   464 kB/s |  10 MB     00:22    
centosplus                             485 kB/s | 610 kB     00:01    
Metadata cache created.
[root@C8-161 ~]# yum install -y yum-utils
Repository extras is listed more than once in the configuration
Last metadata expiration check: 0:01:50 ago on Fri 09 Jul 2021 12:12:09 PM CST.
Dependencies resolved.
=======================================================================
 Package         Architecture Version               Repository    Size
=======================================================================
Installing:
 yum-utils       noarch       4.0.18-4.el8          baseos        70 k

Transaction Summary
=======================================================================
Install  1 Package

Total download size: 70 k
Installed size: 22 k
Downloading Packages:
yum-utils-4.0.18-4.el8.noarch.rpm      176 kB/s |  70 kB     00:00    
-----------------------------------------------------------------------
Total                                  174 kB/s |  70 kB     00:00     
warning: /var/cache/dnf/baseos-8fadb78b165347e1/packages/yum-utils-4.0.18-4.el8.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6d745a60: NOKEY
Rocky Linux 8 - BaseOS                 500 kB/s | 1.6 kB     00:00    
Importing GPG key 0x6D745A60:
 Userid     : "Release Engineering <infrastructure@rockylinux.org>"
 Fingerprint: 7051 C470 A929 F454 CEBE 37B7 15AF 5DAC 6D74 5A60
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                               1/1 
  Installing       : yum-utils-4.0.18-4.el8.noarch                 1/1 
  Running scriptlet: yum-utils-4.0.18-4.el8.noarch                 1/1 
  Verifying        : yum-utils-4.0.18-4.el8.noarch                 1/1 

Installed:
  yum-utils-4.0.18-4.el8.noarch                                        

Complete!

以上是关于Rocky Linux Yum源替换位上海交大镜像站点的主要内容,如果未能解决你的问题,请参考以下文章

Rocky Linux 更新成国内镜像源

Rocky Linux 8.5版本全新图文安装教程并更换阿里镜像源等配置信息

Linux镜像源

原创非常详细!VMware安装Rocky Linux服务器系统并执行优化,包括修改安装镜像源ssh免密等等

原创非常详细!VMware安装Rocky Linux服务器系统并执行优化,包括修改安装镜像源ssh免密等等

yum源加速,替换为阿里云镜像