Wednesday, May 7, 2014

On RHEL, sometimes you get the error when running yum - ""Another app is currently holding the yum lock; waiting for it to exit..."

This error could be because some previous yum command did not complete or has been stopped. In which case, you have to find the pid of that "defunct" process. To do that you can do

$ps aux |grep yum
root      2510  0.0  0.0 175512  2660 pts/0    T    21:13   0:00 sudo yum list mysql
root      2511  0.0  0.0      0     0 pts/0    Z    21:13   0:00 [yum] <defunct>
root      2561  0.0  0.0 175512  2656 pts/0    T    21:20   0:00 sudo yum list mysql
root      2562  0.3  0.2 313968 20388 pts/0    T    21:20   0:00 /usr/bin/python /usr/bin/yum list mysql
tdo       2566  0.0  0.0 103252   824 pts/0    S+   21:21   0:00 grep yum

You would have to remove the lock associated with that lock held by that pid first

$sudo rm -f /var/run/yum.pid 2511

Once you kill the lock, you can kill the defunct process using "kill"

$sudo kill -9 2511

and then you should be able to run yum again.


No comments:

Post a Comment