23

When trying to install a package using yum on Centos, the command is getting stuck at the first part:

loaded plugins: fastestmirror

I've tried:

  1. removing /var/cache/yum/timedhosts.txt See suggestion
  2. yum update yum
  3. making sure there are no other processes running and removing /var/run/yum.pid
  4. yum clean all See suggestion
  5. Checked that DNS works for all the servers in the /etc/yum.repos.d/*.repo files
  6. Set the enabled flag in vi /etc/yum/pluginconf.d/fastestmirror.conf // enabled=0 See Suggestion

... still having the problem.

Any ideas?

Community
  • 1
  • 1
Drew
  • 6,311
  • 4
  • 44
  • 44
  • 4
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Oct 19 '17 at 06:49

3 Answers3

14

For me what ended up fixing it was this:

rm -f /var/lib/rpm/__*
rpm --rebuilddb -v -v

Then rerunning yum command I was trying to run in the first place.

It got stuck for about a minute on:

Determining fastest mirrors

...but then it completed without errors

Suggested Here

Drew
  • 6,311
  • 4
  • 44
  • 44
  • I've tried all the suggestions you listed and it still hangs. Made progress by following the steps provided here: http://superuser.com/questions/384963/yum-hangs-and-wont-respond – harperville Jun 16 '14 at 16:40
  • Stack Overflow is a site for programming and development questions. This question and answers appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Oct 19 '17 at 06:49
13

Worked for me : (+)

Edit the following file.

/etc/yum/pluginconf.d/fastestmirror.conf

Change enabled=1 to enabled=0 to disable the fastestmorror plugin.

That should fix it.

You don't need to restart anything for that change to take effect. Just run yum again.

Milad Safaei
  • 492
  • 1
  • 5
  • 16
1

If you use only ipv4 address but ipv6 address is active. Disable the ipv6 address and then try again.

#vi /etc/sysctl.conf 

net.ipv6.conf.eth0.disable_ipv6 = 1

#sysctl -p  
kijeong
  • 71
  • 8