CentOS Yum forced unlock method

Time:2021-7-28

1、 Error message:

Copy code

The code is as follows:

[[email protected]]# yum list</p>
<p>Existing lock /var/run/yum.pid: another copy is running as pid 3807.</p>
<p>Another app is currently holding the yum lock; waiting for it to exit…

2、 Reason:
It literally means that “another program locks Yum until the yum updatesd program exits”. Yum updatesd is a system update service provided by the system. The installation file is also called Yum updatesd. By default, this service is automatically started (init 5). It will automatically lock Yum when running, This makes it impossible to perform Yum manually after startup.

3、 Solution:
Directly enter the following command in Bash, delete yum.pid and forcibly unlock it.

Copy code

The code is as follows:

rm -rf /var/run/yum.pid