解决yum install 时出现的“State : Sleeping, pid: xxxx”的问题

当我在安装python包时,往往会依赖以下几个包,但是有些电脑会出现以下错误:

[root@pachong1 scrapy-cluster-1.2]# yum install gcc libffi-devel python-devel openssl-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 4776.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:20 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:22 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:24 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:26 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:28 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:30 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:32 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:34 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:36 ago
    State  : Sleeping, pid: 4776
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  52 M RSS (433 MB VSZ)
    Started: Tue Jun 14 11:17:51 2016 - 338 day(s) 4:56:38 ago
    State  : Sleeping, pid: 4776

遇到这个错误我们可以用以下命令解决:

[root@pachong1 scrapy-cluster-1.2]# rm -f /var/run/yum.pid 4776

至此,你安装这些依赖不会报这个错误,这个错误的原因是因为:
/var/run/yum.pid 已被锁定,PID 为 4776 的另一个程序正在运行。另外一个程序锁定了 yum。删除yum.pid即可。

如有问题请加QQ群相互讨论,QQ群号:526855734

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值