CentOS 8 中无法运行 yum update

gro*_*uff 5 centos yum centos8

我想在这篇文章的开头加上这样的免责声明:我对 yum 的功能有些不熟悉,也不熟悉自 CentOS 8 停产以来所需更改的细节。

大约一个月前,我的容器构建无法成功运行,因为当我进行 yum update 时,出现错误。我在这里找到了解决方案并将其添加到我的容器构建中:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
Run Code Online (Sandbox Code Playgroud)

这让我度过了一段时间,直到今天,它似乎又崩溃了。

bash-4.4# yum update
CentOS Linux 8 - AppStream                                                                                                                                                                                   149 kB/s | 8.4 MB     00:58
CentOS Linux 8 - BaseOS                                                                                                                                                                                      113 kB/s | 4.6 MB     00:41
CentOS Linux 8 - Extras                                                                                                                                                                                      716  B/s |  10 kB     00:14
CentOS Linux 8 - PowerTools                                                                                                                                                                                  0.0  B/s |   0  B     01:26
Errors during downloading metadata for repository 'powertools':
  - Curl error (28): Timeout was reached for http://vault.centos.org/centos/8/PowerTools/x86_64/os/repodata/981185e5d80d51024e5246ed47f7f69605160518c22103379bb71376e2dccb14-filelists.xml.gz [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
  - Curl error (28): Timeout was reached for http://vault.centos.org/centos/8/PowerTools/x86_64/os/repodata/4b94ac0555ec1e15718dd9d77f995ec7096d98974b4c7a427b8e03c20e9c663d-primary.xml.gz [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
Run Code Online (Sandbox Code Playgroud)

所以我找到了一些其他的解决方案,但没有一个有效。例如,我找到了这篇文章:CentOS 8 upgade - 如何解决警告:无法加载'/etc/yum.repos.d/CentOS-AppStream.repo',跳过

它让我做到以下几点:

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
Run Code Online (Sandbox Code Playgroud)

dnf 发行版同步

但这样一来,我就明白了:

    bash-4.4# dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
CentOS Linux 8 - Extras                                                                                                                                                                                       22 kB/s |  10 kB     00:00
Error:
 Problem 1: conflicting requests
  - nothing provides centos-gpg-keys = 1:8-3.el8 needed by centos-stream-repos-8-3.el8.noarch
 Problem 2: package centos-linux-release-8.3-1.2011.el8.noarch requires centos-repos(8), but none of the providers can be installed
  - conflicting requests
  - problem with installed package centos-linux-release-8.3-1.2011.el8.noarch
  - nothing provides centos-gpg-keys = 1:8-3.el8 needed by centos-stream-repos-8-3.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Run Code Online (Sandbox Code Playgroud)

如果我给出的条件是我无法更改此容器(CentOS 8)的底层基础映像,那么短期解决方案是什么?我知道长期的解决方案是切换我的操作系统,但我需要在短时间内跛行。

先感谢您!

Dan*_*nin 10

Vault.centos.org 背后的基础设施可能总是不稳定。

RedHat 几乎没有动力去支持它。它适用于其主要操作系统的存档社区版本,该社区版本与 CentOS Stream 的 EOL 版本完全相同。

正如此处详细介绍的,您可能想使用vault.epel.cloud哪个更可靠。

sed -i 's|baseurl=http://vault.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-Linux-*
Run Code Online (Sandbox Code Playgroud)