There are a couple of reasons why this happens but I always managed to get it back to work with the following steps:
- Send the process to the background by hitting
CTRL + Z
- Identify the process id with
ps aux | grep yum
- Kill the yum process with
kill -9 PROCESS_ID
- Run the following commands or put them together in a script:
rm -f /var/lib/rpm/__*
rm -f /var/run/yum.pid
rm -f /var/lib/rpm/__db*
rm -f /var/lib/rpm/.rpm.lock
rm -f /var/lib/rpm/.dbenv.lock
rpm --rebuilddb
yum clean all
- Run
yum update
again