Existing lock /var/run/yum.pid: another copy is running as pid 3004. Another app is currently holdin

本文介绍了解决CentOS系统中遇到的yum锁被占用的问题。通过查看正在运行的yum进程并终止相应进程的方法,成功解决了在安装Redis过程中遇到的应用程序持有yum锁的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天在虚拟机的Cent OS 6上安装redis时,遇到了一个错误,

Loaded plugins: fastestmirror, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 3004.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  26 M RSS (336 MB VSZ)
    Started: Wed Mar 22 16:58:15 2017 - 01:47 ago
    State  : Sleeping, pid: 3004
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  36 M RSS (1.0 GB VSZ)
    Started: Wed Mar 22 16:58:15 2017 - 01:49 ago
    State  : Sleeping, pid: 3004
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  34 M RSS (914 MB VSZ)
    Started: Wed Mar 22 16:58:15 2017 - 01:51 ago
    State  : Sleeping, pid: 3004

找到了一个解决方案,很简单:
从上面的错误可以看出,是一个应用占用了yum锁,由于yum一次只能有一个应用使用,我们查看:

ps aux|grep yum

输出

[root@192 local]# ps aux|grep yum
root       3007  0.0  1.0 321904 20336 pts/1    T    17:00   0:00 /usr/bin/python /usr/bin/yum list
root       3029  0.0  1.0 321900 20336 pts/1    T    17:01   0:00 /usr/bin/python /usr/bin/yum install gcc-c++
root       3032  0.0  0.0 103312   884 pts/1    S+   17:05   0:00 grep yum

可以看到相关应用的pid,使用

kill -9 pid

结束应用就行了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

每天进步一点_点

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值