hanyan-0825

centos执行yum命令 错误汇总(不定时更新)

PID报错

--yum命令时,报错如下

Existing lock /var/run/yum.pid: another copy is running as pid 42106.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  72 M RSS (400 MB VSZ)
    Started: Sun Aug  7 01:53:14 2022 - 00:05 ago
    State  : Running, pid: 42106

问题解析;

yum只能支持一个例程运行,如果有一个例程已经在运行,其他的必须等待该进程退出释放lock。出现这种情况时,再执行yum命令时就会报PID错误,或者yum被锁定了,无法使用;

解决办法:可以通过强制关掉yum进程

执行命令 rm -r /var/run/yum.pid

[root@localhost ~]# rm -f /var/run/yum.pid 
[root@localhost ~]# ls
anaconda-ks.cfg
[root@localhost ~]# yum install -y vim
Updated:
  vim-enhanced.x86_64 2:7.4.629-8.el7_9                                                                                                                 

Dependency Updated:
  vim-common.x86_64 2:7.4.629-8.el7_9                                                                                                                   

Complete!
[root@localhost ~]# 
# 问题解决

posted on 2022-08-07 17:32  寒岩  阅读(187)  评论(0编辑  收藏  举报

导航