gpt4 book ai didi

python - 在 Centos 8 上安装 Python 3 返回 "Failed to synchronize cache for repo ' BaseOS'"

转载 作者:行者123 更新时间:2023-12-04 19:31:50 25 4
gpt4 key购买 nike

我正在使用 CentOS 8。我正在尝试安装 Python 3。命令:sudo dnf install python3 .错误:

Failed to synchronize cache for repo 'BaseOS'



我怎样才能解决这个问题?

最佳答案

Centos 用 $releasever 的值做了一些有趣的事情因为他们使用的是完整版 8.0.1905而不仅仅是 8 .当新版本8.1.1911发布他们存档旧版本。如果您安装旧媒体或使用旧的 vagrant box,这可能会导致以下问题:

[vagrant@localhost ~]$ sudo dnf upgrade
CentOS-8.0 - AppStream 1.6 kB/s | 38 B 00:00
CentOS-8.0 - Base 748 B/s | 38 B 00:00
CentOS-8.0 - Extras 126 B/s | 38 B 00:00
Extra Packages for Enterprise Linux Modular 8.0 - x86_64 53 kB/s | 63 kB 00:01
Extra Packages for Enterprise Linux 8.0 - x86_64 80 kB/s | 63 kB 00:00
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Failed to synchronize cache for repo 'extras', ignoring this repo.
Failed to synchronize cache for repo 'epel-modular', ignoring this repo.
Failed to synchronize cache for repo 'epel', ignoring this repo.
Dependencies resolved.
Nothing to do.
Complete!

解决此问题的方法是在 dnf 上指定 Centos 版本。使用 --releasever 的命令行像这样的选项:
[vagrant@localhost ~]$ sudo dnf upgrade --releasever=8
CentOS-8 - AppStream 164 kB/s | 7.0 MB 00:43
CentOS-8 - Base 313 kB/s | 2.2 MB 00:07
CentOS-8 - Extras 5.1 kB/s | 5.5 kB 00:01
Extra Packages for Enterprise Linux Modular 8 - x86_64 63 kB/s | 116 kB 00:01
Extra Packages for Enterprise Linux 8 - x86_64 5.9 MB/s | 6.5 MB 00:01
Dependencies resolved.

关于python - 在 Centos 8 上安装 Python 3 返回 "Failed to synchronize cache for repo ' BaseOS'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60540892/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com