当前位置 : 主页 > 操作系统 > centos >

linux中yum update被占用(Another app is currently holding the yum lock)的解决办法

来源:互联网 收集:自由互联 发布时间:2023-07-29
问题描述: 在运行yum命令时,提示Another app is currently holding the yum lock; waiting for it to exit或Another app is currently holding the yum lock; waiting for it to exit 错误信息,具体内容如下: Another app is

问题描述:

在运行yum命令时,提示”Another app is currently holding the yum lock; waiting for it to exit”或”Another app is currently holding the yum lock; waiting for it to exit… ” 错误信息,具体内容如下:

Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory :  37 M RSS (271 MB VSZ)
Started: Thu Nov 24 11:19:33 2016 - 00:01 ago
State  : Traced/Stopped, pid: 8907
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory :  37 M RSS (271 MB VSZ)
Started: Thu Nov 24 11:19:33 2016 - 00:02 ago
State  : Traced/Stopped, pid: 8907
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory :  37 M RSS (271 MB VSZ)
Started: Thu Nov 24 11:19:33 2016 - 00:03 ago
State  : Traced/Stopped, pid: 8907

解决办法:

自由互联热门推荐:PDF电子发票识别软件,一键识别电子发票并导入到Excel中!10大顶级数据挖掘软件!人工智能的十大作用!

1.杀掉yum进程

第一步,查找yum进程的PID

ps -ef | grep yum

得到下面的结果:

root  1985  1650  0 16:42 pts/0 0:00 grep --color=auto yum
root  5804     1  0  2017 ?    00:00:00 /usr/bin/python /usr/bin/yum update

其中5804就是yum进程的PID

第二步,使用kill命令杀掉进程:

kill -9 5804

2.删除yum的pid文件

rm -f /var/run/yum.pid

示例操作:

第一种情况,通过杀掉yum进程的方式来解决问题。

ps -ef | grep yum
# 得到yum进程的PID
kill -9 5804

第二种情况,通过删除yum的pid文件来解决问题。

rm -f /var/run/yum.pid

注意:

以上两种方法都需要用root用户执行。

上一篇:Linux yum安装过程图文详解
下一篇:没有了
网友评论