Wednesday 25 July 2007

Linux Tips #01 - Killing the Yum.pid

First do
Code:
ps aux | grep yum
to see if it's running.

If it is running in the background you could type
Code:
fg

that would bring the last background task to the foreground.

Or you could kill the process using the info from the ps command.

If it isn't running and the file is left over, you can delete the file /var/run/yum.pid and run it again
Code:
jobs
shows jobs you started. First one is job number 1, second 2 etc. If you found out there was job number 1 that was your yum update, then simply
Code:
kill %1
to kill it. %1 because it's the number one process of your own, not process ID 1.

Alternatively,
Code:
ps -e | grep yum
and you should get the process ID (pid). Use that number:
Code:
kill number
or just
Code:
killall yum

If you can't kill it, make some force:
Code:
killall -9 yum

Or if you find it's not running anymore, but lock file exists, just remove it:
Code:
rm /var/run/yum.pid
And then re-try

No comments: