关于如何诊断和解决此问题有什么指示吗?

关于如何诊断和解决此问题有什么指示吗?

在升级到 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

修复无法下载存储库“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-*

下载存储库“extras”元数据时出错

百胜

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

未完成任务

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

关于如何诊断和解决此问题有什么指示吗?

答案1

从 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
                            

升级交易即使没有完全更新也可以进行。

不要启用仅用于存档的保险库。保留它的安装会鼓励使用过期软件的不良做法。

显然 extras repo 存活了 8 年,并且 Stream(和 SIG)的发布包就存放在这里。

答案2

问题解决了

CentOS-Base.repo 已“损坏”

搞乱了 CentOS-Base.repo

[root@den2-pgstool1 yum.repos.d]# cat CentOS-Base.20220208.bak
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the ##mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[BaseOS]
name=CentOS-$releasever - Base
###mirrorlist=http://##mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=http://mirrors.kernel.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#[BaseOS]
#name=CentOS-$releasever - Base
###mirrorlist=http://##mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
#gpgcheck=1
#enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS-$releasever - Base
###mirrorlist=http://##mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=http://mirrors.kernel.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#[base]
#name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
#baseurl=https://mirrors.kernel.org/centos/$releasever/os/$basearch/
#baseurl=http://den2-fs1.polycomrp.net/centos/$releasever/os/$basearch/
#proxy=_none_
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
#[updates]
#name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
#baseurl=https://mirrors.kernel.org/centos/$releasever/updates/$basearch/
#baseurl=http://den2-fs1.polycomrp.net/centos/$releasever/updates/$basearch/
#proxy=_none_
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
#[extras]
#name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/
#baseurl=https://mirrors.kernel.org/centos/$releasever/extras/$basearch/
#gpgcheck=1
#enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#[base]
#name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
#baseurl=http://mirrors.kernel.org/centos/$releasever/os/$basearch/
#baseurl=http://den2-fs1.polycomrp.net/centos/$releasever/os/$basearch/
#proxy=_none_
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
#released updates
#[updates]
#name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
#baseurl=http://mirrors.kernel.org/centos/$releasever/updates/$basearch/
#baseurl=http://den2-fs1.polycomrp.net/centos/$releasever/updates/$basearch/
#proxy=_none_
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8

手动修复版本

[root@den2-pgstool1 yum.repos.d]# cat CentOS-Base.repo.rpmsave
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the ##mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
[BaseOS]
name=CentOS-$releasever - Base
###mirrorlist=http://##mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
#baseurl=http://mirrors.kernel.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS-$releasever - Base
###mirrorlist=http://##mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
#baseurl=http://mirrors.kernel.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

相关内容