CentOS 执行yum时提示 ”/var/run/yum.pid 已被锁定“

执行yum时出错,具体信息如下:

 1 [kelly_zhang@bogon ~]$ sudo yum install shutter
 2 已加载插件:fastestmirror, langpacks
 3 /var/run/yum.pid 已被锁定,PID 为 3432 的另一个程序正在运行。
 4 Another app is currently holding the yum lock; waiting for it to exit...
 5   另一个应用程序是:PackageKit
 6     内存: 28 M RSS (445 MB VSZ)
 7     已启动: Sun Sep  6 13:39:17 2020 - 00:12之前
 8     状态  :睡眠中,进程ID:3432
 9 Another app is currently holding the yum lock; waiting for it to exit...
10   另一个应用程序是:PackageKit
11     内存: 28 M RSS (445 MB VSZ)
12     已启动: Sun Sep  6 13:39:17 2020 - 00:14之前
13     状态  :睡眠中,进程ID:3432
14 ^C

解决方法:

  强制关掉yum进程来解决这个问题,直接在终端运行如下命令将该文件删除,然后再次运行yum即可

sudo rm -f /var/run/yum.pid
原文地址:https://www.cnblogs.com/xiykj/p/13621633.html