您的浏览器过于古老 & 陈旧。为了更好的访问体验, 请 升级你的浏览器
PHP是最好的语言 发布于2019年12月12日 15:11 最近更新于 2019年12月12日 16:02

Linux yum 被锁:Another app is currently holding the yum lock

2497 次浏览 读完需要≈ 8 分钟 Linux

我使用的是 CentOS 7 64位系统,之前使用 yum update 命令准备进行软件更新,但是中途由于开会离开了较长的一段时间。

结果发现 SSH 连接会话已经关闭了,我只好又重新登录,重新执行 yum update 命令,结果一直输出如下提示:

Existing lock /var/run/yum.pid: another copy is running as pid 27262.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:53:51 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:53:53 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:53:55 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:53:57 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:53:59 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:01 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:03 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:05 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:07 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:09 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:11 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:13 ago
    State  : Sleeping, pid: 27262
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory : 168 M RSS (1.5 GB VSZ)
    Started: Wed Dec 11 15:05:17 2019 - 23:54:15 ago
    State  : Sleeping, pid: 27262

看样子好像是之前离开时的那个 yum 进程还没有被退出,请问还如何解决呢?

求各位大神帮帮忙,3Q。

1 个回答

Ready · 5年前

Another app is currently holding the yum lock; waiting for it to exit...

The other application is: yum

提示信息中,这两句话的意思就是:有另外一个应用正在持有yum锁,等待(它)退出……这个应用的名字叫作:yum。

而且,提示信息里面 连另外一个进程的PID也给你标识出来了。

按道理,你只需要结束掉那个进程,释放掉其占用的 yum lock 即可。

你可以使用如下 Shell 命令来解决该问题:

rm -f /var/run/yum.pid

撰写答案