dnf进程CPU使用率高,dnf和yum命令卡住,无法退出

问题:

dnf使用率很高,接近100%

解决:

top命令查看dnf使用率很高,接近100%

根据pid查看进程信息,ps -ef | grep PID,发现是执行了命令dnf makecache导致的

直接杀掉次进程,kill -9 PID或者killall dnf

问题:

测试yum使用情况或者dnf使用情况

发现yum和dnf相关的命令使用后,就卡住了,ctrl + c和ctrl + d都无反应

解决:

再次登录,ps -ef | grep yum和ps -ef |grep dnf 查看相关进程然后kill掉

检查 /var/log/dnf.log 和 /var/log/yum.log 看看有什么报错

查看dnf日志如下

2024-09-29T14:58:05Z INFO --- logging initialized ---
2024-09-29T14:58:05Z DDEBUG timer: config: 15 ms
2024-09-29T14:58:05Z DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
2024-09-29T14:58:05Z DEBUG DNF version: 4.2.15
2024-09-29T14:58:05Z DDEBUG Command: dnf makecache --timer 
2024-09-29T14:58:05Z DDEBUG Installroot: /
2024-09-29T14:58:05Z DDEBUG Releasever: 10
2024-09-29T14:58:05Z DEBUG cachedir: /var/cache/dnf
2024-09-29T14:58:05Z DDEBUG Base command: makecache
2024-09-29T14:58:05Z DDEBUG Extra commands: ['makecache', '--timer']
2024-09-29T14:58:05Z DEBUG Making cache files for all metadata files.
2024-09-29T14:58:06Z DEBUG ks10-adv-os: has expired and will be refreshed.
2024-09-29T14:58:06Z DEBUG ks10-adv-updates: has expired and will be refreshed.
2024-09-29T14:58:06Z DEBUG reviving: 'ks10-adv-os' can be revived - repomd matches.
2024-09-29T14:58:06Z DEBUG ks10-adv-os: using metadata from Sun 29 Sep 2024 04:02:27 PM CST.
2024-09-29T14:58:06Z DEBUG reviving: 'ks10-adv-updates' can be revived - repomd matches.
2024-09-29T14:58:06Z DEBUG ks10-adv-updates: using metadata from Sun 29 Sep 2024 04:03:25 PM CST.
2024-09-29T14:58:06Z DEBUG os-release: falling back to basic User-Agent: distro Kylin Linux Advanced Server not whitelisted
2024-09-29T14:58:06Z DEBUG No module defaults found
2024-09-29T14:58:06Z DDEBUG timer: sack setup: 149 ms
2024-09-29T14:58:06Z DEBUG Completion plugin: Generating completion cache...
2024-09-29T14:58:06Z INFO Metadata cache created.
2024-09-29T14:58:06Z DDEBUG Cleaning up.

没看出来很明显的报错,但是涉及到dnf和yum都无法使用,他们管理的rpm包需要确认一下

cd /var/lib/rpm/

发现下面存在__db.00这种类似的文件,直接清除并重建

# 清除原rpmdb文件:
rm -rf __db.*
# 重建rpm数据库: 
rpm --rebuilddb
# 清除yum缓存:
yum -y clean all
# 重建缓存:
dnf makecache
# 或者
yum makecache

问题解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

工具人01

仗剑天涯,从你的打赏开始

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值