centos7系统yum命令提示占用,无法执行的解决方法

[root@b4DUMzFSVA ~]# yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
Loaded plugins: fastestmirror
Existing lock /var/run/yum.pid: another copy is running as pid 4028.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  23 M RSS (418 MB VSZ)
    Started: Tue Feb  1 15:43:21 2022 - 00:25 ago
    State  : Sleeping, pid: 4028
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  29 M RSS (424 MB VSZ)
    Started: Tue Feb  1 15:43:21 2022 - 00:27 ago
    State  : Running, pid: 4028
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  29 M RSS (424 MB VSZ)
    Started: Tue Feb  1 15:43:21 2022 - 00:29 ago
    State  : Running, pid: 4028
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  27 M RSS (422 MB VSZ)
    Started: Tue Feb  1 07:43:22 2022 - 00:31 ago
    State  : Running, pid: 4028

原因是yum被某个程序占用,粗暴的解决方法是执行以下命令,强制结束占用yum的进程:

rm -f /var/run/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即可
点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注

×
订阅图标按钮