在 CentOS 8上Yum或Dnf使用失败

根本原因: 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 了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值