报错:Another app is currently holding yum lock

一、问题原因:

在运行yum 相关命令“yum remove”的时候,不知道怎么回事无法进行下载安装,报出 Another app is currently holding the yum lock; waiting for it to exit... 的错误提示。

二、环境:

centos7 Linux

三、解决问题:

1、分析:报错显示/var/run/yum.pid 已被锁定,pid为3347。

 Another app is currently holding the yum lock. 意为另外一个应用正在锁住进程锁。      

waiting for it to exit.... 意为该应用等待解锁

[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、处理

使用kill -9 把提示进程杀掉,这样就可以了,可以执行yum命令了。

[root@localhost run]# kill -9 3347

 如果,上述操作还不能解决,可以使用下面的命令

killall -9 yum

假如还是无法解决,继续执行

rm -f /var/run/yum.pid 

然后执行更新yum

yum -y update

最后确保yum-updatesd已经启动

/etc/init.d/yum-updatesd status

/etc/init.d/yum-updatesd start

猜你喜欢

转载自blog.csdn.net/m0_62455795/article/details/128836682