zoukankan      html  css  js  c++  java
  • [Linux/CENTOS]YUM提示: Another app is currently holding the yum lock; waiting for it to exit...

    1 问题描述

    使用yum安装Nginx的安装依赖组件:

    yum -y install gcc gcc-c++ automake autoconf libtool make
    

    但是,在执行过程中出现如下信息:

    [root@localhost software]# yum -y install gcc gcc-c++ automake autoconf libtool make
    Loaded plugins: fastestmirror, langpacks
    Existing lock /var/run/yum.pid: another copy is running as pid 3289.
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:27 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:29 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:31 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:33 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:35 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:37 ago
        State  : Sleeping, pid: 3289
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 133 M RSS (551 MB VSZ)
        Started: Wed Jun 16 09:22:32 2021 - 08:39 ago
    ...
    

    2 现象分析

    [root@localhost software]# netstat -lntp | grep -i 3289
    [root@localhost software]# ll /proc/3289 | grep -i CWD
    lrwxrwxrwx. 1 root root 0 Jun 16 09:34 cwd -> /
    [root@localhost software]# ps -ef | grep -i 3289
    root       3289   2040  2 09:22 ?        00:00:17 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none
    root       3721   3289  3 09:33 ?        00:00:02 /usr/bin/python /usr/libexec/urlgrabber-ext-down
    root       3736   3508  0 09:34 pts/1    00:00:00 grep --color=auto -i 3289
    

    3 解决方法

    • 方法1: kill掉该yum进程
    [root@localhost software]# kill -9 <pid>
    
    • 方法2:通过强制关掉yum进程
    rm -f /var/run/yum.pid
    

    然后,就可以重新使用yum了。

    X 参考文献

    赞赏-支付宝二维码
    本文作者千千寰宇
    本文链接 https://www.cnblogs.com/johnnyzen
    关于博文:评论和私信会在第一时间回复,或直接私信我。
    版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
    声援博主:若本文对您有帮助,可点击右下角推荐一下。您的鼓励、【赞赏】(左侧赞赏支付码)是博主技术写作的重要动力!
  • 相关阅读:
    explain详解与索引最佳实践
    MySQL的配置文件
    MySQL索引数据结构红黑树,Hash,B+树详解
    elasticsearch 进阶
    淘宝服务端高并发分布式架构演进之路
    http请求的header的一个小细节
    一次解决idea maven settings.xml文件不生效
    SpringBoot dev-tools vjtools dozer热启动类加载器不相同问题
    spring boot eclipse 远程调试
    vscode 同步配置
  • 原文地址:https://www.cnblogs.com/johnnyzen/p/14888178.html
Copyright © 2011-2022 走看看