有时候在使用yum进行安装任务功能时,结果提示
# yum -y install vim
Loaded plugins: fastestmirror
Existing lock /var/run/pid:another copy is running as pid 1718
Another app is currently holding the yum lock; waiting for it to exit...
...
此时可能有其他应用正在使用,比如系统升级、刚才进行安装任务时进行了挂起。从而使yum在锁定状态中。
此时可以使用ps命令查看使用yum的进程:ps aux|grep yum
# kill -s 9 1718
# ps aux|grep yum
root 1718 0.0 1.3 353756 24908 T 04:54 0:00 /usr/bin/python /bin/yum -y install vim
root 1720 0.0 1.3 353756 24716 T 04:54 0:00 /usr/bin/python /bin/yum -y install vim
root 1739 0.0 0.0 112812 968 R+ 05:01 0:00 grep --color=auto yum
此时发现使用kill命令无法杀掉该进程,则此时可以将进行强制关闭yum进程来解除占用
# rm -f /var/rum/yum.pid
通过强制关闭之后,就可以使用yum了
永久禁止该错误的方法:
永久禁止该错误
```
[root@oracle pluginconf.d]# cd /etc/yum/pluginconf.d/
[root@oracle pluginconf.d]# ls
product-id.conf refresh-packagekit.conf rhnplugin.conf security.conf subscription-manager.conf
[root@oracle pluginconf.d]# vim refresh-packagekit.conf
[main]
enabled=0 --将原来的1改成0即可