1. Cause of the problem:
When running the yum-related command "yum remove", I don't know why I cannot download and install it, and the error message "Another app is currently holding the yum lock; waiting for it to exit..." is reported.
2. Environment:
centos7 Linux
3. Solve the problem:
1. Analysis: The error message shows that /var/run/yum.pid has been locked and the pid is 3347.
Another app is currently holding the yum lock. This means that another app is currently holding the process lock.
waiting for it to exit.... means the app is waiting to be unlocked
[root@localhost ~]# yum remove `rpm -qa | egrep 'qemu|virt|KVM'` -y
已加载插件:fastestmirror, langpacks
/var/run/yum.pid 已被锁定,PID 为 3347 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit...
另一个应用程序是:PackageKit
内存:292 M RSS (713 MB VSZ)
已启动: Wed Feb 1 15:57:25 2023 - 27:07之前
状态 :睡眠中,进程ID:3347
Another app is currently holding the yum lock; waiting for it to exit...
......
2. Processing
Use kill -9 to kill the prompt process. That's it. You can execute the yum command.
[root@localhost run]# kill -9 3347
If the above operation cannot solve the problem, you can use the following command
killall -9 yum
If it still cannot be solved, continue execution
rm -f /var/run/yum.pid
Then execute update yum
yum -y update
Finally, make sure yum-updatesd is started
/etc/init.d/yum-updatesd status
/etc/init.d/yum-updatesd start