Yum Download Mirror – Switching To The Fastest Mirror On CentOS/Fedora/RHEL

Author Topic: Yum Download Mirror – Switching To The Fastest Mirror On CentOS/Fedora/RHEL  (Read 3493 times)

mahbub-web

  • Guest
Yum Download Mirror – Switching To The Fastest Mirror On CentOS/Fedora/RHEL

Have you ever found when using yum to update your system or install new software that the downloads come at incredibly slow speeds or extremely slow to respond?

There is a solution!

When you run into the issue of slow download speeds via yum there are a couple of things you can do to ensure yum will select a new mirror when attempting to grab the files.

First you will want to remove the yum fast mirror cache file:

Code: [Select]
rm /var/cache/yum/timedhosts.txt
Once you have removed the cache file you will want to again run yum and let is grab a new set of mirrors and select the fastest one for you.

In some cases you may once again end up with the same slow download mirror, in this case you will want to do the following:

Remove the yum cache file:

Code: [Select]
rm /var/cache/yum/timedhosts.txt
Once removed you will want to edit “fastestmirror.conf”

Code: [Select]
nano /etc/yum/pluginconf.d/fastestmirror.conf
Inside “fastestmirror.conf” you will want to locate “#exclude=.gov, facebook” and edit to look like the following:

Code: [Select]
exclude=.gov, facebook, mirror.slowmirror.com
We did two things in the edit:
1. We remove the “#” which makes the line active.
2. Added “, mirror.slowmirror.com”
You will want to replace “mirror.slowmirror.com” with the actual mirror name/URL or it will not work!
Once done you want to close and save!

Code: [Select]
ctrl + x
 Y
 Enter

Once saved, re-run yum and you should now get a completely new mirror. If you again run into a slow mirror you need only to repeat the steps above to remove that mirror, however if you are finding all mirrors to be slow, make sure you check the system is not actually have a network issue.

ref: http://www.servernoobs.com/yum-download-mirror-switching-to-the-fastest-mirror-on-centosfedorarhel/