centos8替換成阿里雲映象

lyxxxh發表於2022-02-14

文件

developer.aliyun.com/mirror/centos...

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo


 yum makecache 

報錯 映象404

CentOS Linux 8 - AppStream                                                                                    6.2 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

報錯原因

解決報錯

AppStream

vim /etc/yum.repos.d/CentOS-Linux-AppStream.repo
替換 baseurl

#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/AppStream/$basearch/os/

baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/$basearch/os/

再次執行 yum makecache

CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                   199 kB/s | 3.9 kB     00:00    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                  18 kB/s | 1.5 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                              298 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - AppStream                                                                                    1.0 MB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                                                                        29 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'baseos':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

可以看AppStream 已經通過了, 輪到BaseOS404,還是一樣的替換步驟。

BaseOS

vim /etc/yum.repos.d/CentOS-Linux-BaseOS.repo

#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/AppStream/$basearch/os/

baseurl=http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/$basearch/os/

繼續執行yum makecache,又輪到PowerTools 報錯了。

PowerTools

vim /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
一樣替換

再次yum makecache

CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                   189 kB/s | 3.9 kB     00:00    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                  99 kB/s | 1.5 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                              281 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - AppStream                                                                                    1.5 MB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                                                                       1.2 MB/s | 4.3 kB     00:00    
CentOS Linux 8 - PowerTools                                                                                    36 MB/s | 8.4 MB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                                                                1.2 MB/s | 4.7 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                                                                1.3 MB/s | 4.7 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64                                                        2.0 kB/s | 2.8 kB     00:01    
Metadata cache created.

全部通過。

本作品採用《CC 協議》,轉載必須註明作者和本文連結
專心學習不瞎搞

相關文章