Yum gets stuck
Sometimes Yum gets stuck when we are trying to install or update packages. No error messages will be displayed at that time. It just freezes after 2 lines of output:
There could be several reasons why it happens, and the fixes are pretty simple.
1. Check if you have the DNS set properly in your server. You can try something like:
ping www.google.com
If you are getting a response, your DNS is working fine. If not, check the /etc/resolv.conf file Add the following in it (if not already exists):
nameserver 8.8.8.8
Now try again. If it still does not work, check step 2
2. Clean and rebuild the RPM databases. Keep a backup before removing the files.
rm -f /var/lib/rpm/__*
rpm --rebuilddb -v -v
yum clean all
It should work now. If you’re still facing issues, it’s probably the firewall. Check your firewall rules and make sure that the server can contact the remote repositories.