当我在安装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即可。