[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命令行上使用--releasever选项指定Centos版本,如下所示:
[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.
2条答案
按热度按时间vcudknz31#
Centos对
$releasever
的值做了一些有趣的事情,他们使用的是完整版本8.0.1905
,而不是8
。当新版本8.1.1911
发布时,他们存档了旧版本。如果您安装旧媒体或使用旧的vagrant box,这可能会导致以下问题:此问题的修复方法是在
dnf
命令行上使用--releasever
选项指定Centos版本,如下所示:vktxenjb2#
在mirror.centos.orgvault.centos.org相应的存储库文件中,将baseurl从www.example.com更改为www.example.com,如下所示:
/etc/yum.存储库d/