Specifying multiple yum mirrors

Specifying multiple yum mirrors

It seems like every few years I come back to the same issue: when repos in /etc/yum.repos.d/ use a mirrorlist line, I invariably get some weird mirror that’s extremely slow. I’d rather use baseurl= and point it at a fast mirror I found by hand, but I don’t want to wed myself to one mirror that could go down. I start looking at how to generate a local mirrorlist (which can be done), but while investigating the syntax, discover this:

You can specify multiple URLs in the baseurl= statement. (It’s actually in the yum.conf manpage.)

And thus, something like this works great:

baseurl=http://mirror.metrocast.net/fedora/epel/$releasever/Everything/$basearch/
  http://mirrors.mit.edu/epel/$releasever/Everything/$basearch/
  http://mirrors.rit.edu/epel/$releasever/Everything/$basearch/

They warn to not use multiple baseurl= statements; put them all in one and just indent subsequent ones. In older RHEL/CentOS versions, you could specify a failovermethod parameter of either round-robin or priority, but this was apparently not included in dnf.

I should really learn dnf…

One comment

  1. Pingback: Pull-through mirrors – N1ZYY

Leave a Reply

Your email address will not be published. Required fields are marked *