当CentOS 8系统不能更新

本文转载自:

https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal

今天闲来无事,想把自己的服务器升级一下:

sudo dnf -y update

然后就出错了!!!

Repository epel is listed more than once in the configuration
CentOS Linux 8 - AppStream
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

找了一篇相同问题的帖子,开始一顿操作

先是导入8.3的gpg key:

wget 'http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm'
sudo rpm -i 'centos-gpg-keys-8-3.el8.noarch.rpm'

然后切换repo源由centos-linux-repos调整为centos-stream-repos:

sudo dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos

最后更新所有软件到最新的稳定发行版:

sudo dnf distro-sync

此条目发表在系统分类目录,贴了, 标签。将固定链接加入收藏夹。