根本原因: CentOS 8 - 到 2021 年底结束更新。
错误截图:
错误关键字:
Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Note: Unable to synchronize the cache for 'AppStream' repo, ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Note: Unable to synchronize the cache for 'BaseOS' repo, ignoring this repo.
Last metadata expiration check: 0:45:16 ago on Thu Jul 7 19:20:18 2022.
Note: Last metadata expiration check: 0:45:16 before Thursday, July 7, 2022, 19:20:18.
No match for argument: wget
Note: Parameter mismatch: wget.
Error: Unable to find a match
Note: Error: No match found.
解决方案:
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-*
更新源:
yum clean all
yum makecache
逐一执行上述步骤,然后就可以使用 Dnf 或 Yum 了。