Admin-Ahead Community

Linux => General Linux => Topic started by: nandulalr on December 13, 2018, 12:31:05 am

Title: Yum gets stuck
Post by: nandulalr on December 13, 2018, 12:31:05 am
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:

Code: [Select]
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):

Code: [Select]
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.

Code: [Select]
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.