[Linux/CENTOS]YUM提示: Another app is currently holding the yum lock; waiting for it to exit...
2023-09-27 14:24:41 时间
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
...
![](https://img2020.cnblogs.com/blog/1173617/202106/1173617-20210616094542215-377691488.png)
2 现象分析
![](https://img2020.cnblogs.com/blog/1173617/202106/1173617-20210616094707617-1419272318.png)
[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>
![](https://img2020.cnblogs.com/blog/1173617/202106/1173617-20210616094852199-1510628514.png)
- 方法2:通过强制关掉yum进程
rm -f /var/run/yum.pid
然后,就可以重新使用yum了。
X 参考文献
相关文章
- Linux Command uniq
- Linux解压缩tar.zst类型文件
- 在 Windows 读取 Linux 分割区的 Ext2Fsd
- 使用一次性密码本通过 SSH 安全登录 Linux
- 一位开发者的 Linux 容器之旅
- linux查看 rsync 服务状态
- linux /proc 接口
- Linux系统的时间比北京时间慢12个小时的处理方案(将EDT时区改为CST)
- 《Storm分布式实时计算模式》——2.3 在Linux上安装Storm
- Linux下,连接器ld链接顺序的总结
- 优化存储性能?你需要关注这些Linux I/O调度程序选项
- linux文件命令汇总
- Linux 升级 Python 至 3.x
- linux 如何重命名
- linux清理磁盘
- Linux必须熟记的文件