使用yum安裝,結果提示:
yum -y install ansible
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 87 M RSS (844 MB VSZ)
Started: Wed May 30 19:20:37 2018 - 07:36 ago
State : Sleeping, pid: 9958
可能是系統自動升級正在運行,yum在鎖定狀態中。
已經有一個yum進程在運行了,使用kill幹掉它:
kill -s 9 9958
ps aux|grep yum
root 9958 0.7 6.5 871192 96192 ? SN 19:20 0:07 /usr/bin/python/usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none
很遺憾,kill對付不了它,那怎麼辦呢?
可以通過強制關掉yum進程:
rm -f /var/run/yum.pid
然後就可以使用yum了