Centos

CentOS 8 升級 - 如何解決警告:載入 ‘/etc/yum.repos.d/CentOS-AppStream.repo’ 失敗,跳過

  • February 9, 2022

在升級到 Stream 之前嘗試更新我的 CentOS Linux 8 堆棧

CentOS Linux 8

[root@den yum.repos.d]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
[root@den yum.repos.d]# uname -r
4.18.0-147.5.1.el8_1.x86_64

修復無法下載 repo ‘AppStream’ 的元數據

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

下載儲存庫“附加”的元數據時出錯

百勝

yum clean all
yum update -y
yum check-update
yum update -y

注意警告Warning: failed loading '/etc/yum.repos.d/CentOS-AppStream.repo', skipping.

Warning: failed loading '/etc/yum.repos.d/CentOS-AppStream.repo', skipping.
Repository extras is listed more than once in the configuration
CentOS-8 - Base 106 kB/s | 4.6 MB 00:44
CentOS-8 - Base 1.0 kB/s | 8.1 kB 00:08
Errors during downloading metadata for repository 'extras':
- Status code: 404 for https://vault.centos.org/centos/8/updates/x86_64/repodata/repomd.xml (IP: FILTERED)
Error: Failed to download metadata for repo 'extras': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

DNF

rm -rf /var/cache/dnf
dnf update --refresh
Warning: failed loading '/etc/yum.repos.d/CentOS-AppStream.repo', skipping.
Repository extras is listed more than once in the configuration
CentOS-8 - Base                                                                                                                               10 kB/s | 3.9 kB     00:00
CentOS-8 - Base                                                                                                                               23 kB/s | 8.1 kB     00:00
Errors during downloading metadata for repository 'extras':
 - Status code: 404 for https://vault.centos.org/centos/8/updates/x86_64/repodata/repomd.xml (IP: FILTERED)
Error: Failed to download metadata for repo 'extras': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

有關如何診斷和解決此問題的任何指示?

從 CentOS 8 切換到 Stream 8 指令隱藏在下載頁面上的幾下點擊下

# Converting from CentOS Linux 8 to CentOS Stream 8                               
dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
                           

升級交易可以在未完全更新的情況下進行。

不要啟用僅用於存檔的保管庫。讓它安裝會鼓勵使用報廢軟體的不良做法。

顯然,額外的 repo 可以存活 8 年,並且 Stream(和 SIG)的發布包存在。

引用自:https://serverfault.com/questions/1093046