Wednesday, January 25, 2012

Aborting yum

If yum aborted by Ctrl-C and restarted, you'll get this message continuously and cannot proceed:

# yum update
^C
# yum update
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...

What to do:

Look for the 'yum.pid' file and delete it.

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


Alternatively, you can find out what's locking up yum by giving:

# ps aux | grep yum

Take note of the pid number, then kill the process:

# kill -9 (insert pid number)

Confirm that the 'yum.pid' file has been deleted and you should be able to restart yum.

# dir
# yum update

This should do it. In Ubuntu, the same problem requires you to search and delete two files...