Solution to the problem that Yum update is currently holding the yum lock in Linux

Time:2019-12-9

Use Yum to install the scheduled task function. The result is as follows:

Copy code

The code is as follows:

# yum -y install vixie-cron
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid <font color=”#ff0000″>25960</font>.
Another app is currently holding the yum lock; waiting for it to exit…

Maybe the system automatic upgrade is running, and Yum is in the locked state.
There is already a Yum process running. Kill it with kill:

Copy code

The code is as follows:

# kill -s 9 25960
# ps aux|grep yum
root 6744 0.0 0.0 103260 900 pts/1 S+ 14:59 0:00 grep yum
root 25960 0.0 0.0 0 0 ? Z Sep19 0:01 [yumBackend.py] <defunct>

I’m sorry, kill can’t deal with it, so what should I do?

You can force the yum process to shut down:

#rm -f /var/run/yum.pid

Then you can use yum. If not, you can restart yum

/sbin/service yum-updatesd restart

The following is the supplement of other netizens:

Supplement 1.

Sometimes, under Linux, yum update will prompt:

Another app is currently holding the yum lock solution

The solution is to kill the yum process in the cache and restart yum.

Clear processes in cache:

rm -f /var/run/yum.pid

Restart Yum (my system is Fedora)

systemctl status yum-updatesd.service

CentOS users use:

/sbin/service yum-updatesd restart

Supplement two,

Error in CentOS Yum – y install GCC * gcc-c + + * Autoconf * automake * zlib * libxml * ncurses devel * libmcrypt * libtool *:

 

1) what’s the matter? According to the prompt, the system process already has an update running. In the process view: PS – EF | grep update

2) kill the process through kill. After killing, the error is still the same. In the original directory / var / run, there was also the process ID of Yum. You need to forcibly delete the process ID file:

 

3) restart the yum update service at the same time, as follows:

4) finally, re install Yum – y install GCC * gcc-c + + * Autoconf * automake * zlib * libxml * ncurses devel * libmcrypt * libtool * and it is normal

The above is the collation of the developer editor. I hope you can support the developer website more.