5

I have two CentOS servers: dev and prod. Located at different sites and, as a result, yum on each tends to use different mirrors.

This morning the dev machine alerted me that there were some updates. I dutifully ran "sudo yum update" to get them, noted the kernel upgrade, rebooted and tested. All is well.

Did the same on the production server but it assures me it doesn't need any stinkin' updates. (yet) Apparently the chosen fastest mirror(s) haven't received the updates yet.

Coincidentally, I'll be doing hardware maintenance on that prod server in a few hours. Since I tend to measure his uptime in months, I'd really like to get the kernel update before I shut it down just to have it -- and not have to schedule another reboot in a day.

How do I tell yum to try different mirrors? Is this a function of yum or that "fastestmirror" plugin?

Updated 35 minutes later: Ironically, the prod server just notified me that it now has updates ready. Any suggestions will be tried "next time" this situation arises :-)

2 Answers 2

7

Can't you just not use 'mirrorlist' in /etc/yum.repos.d/centos-base.repo (something like that), but just a 'baseurl' and force both boxes to the same mirror?

2
  • /etc/yum.repos.d/CentOS-Base.repo? To summarize: Comment out mirrorlist line and uncomment the baseurl line in each stanza. That seems way easier than anything I had dreamed up :-) Thank you, I'll give that a shot next time.
    – Chris_K
    Jun 19, 2009 at 18:10
  • oh look, it is right there in the comments at the top of the file. OK, now I feel lame!
    – Chris_K
    Jun 19, 2009 at 18:11
0

I don't know if the fastest-mirror plugin allows that but if you find a mirror that is unreliable, and this is a dirty solution i'll freely admit that, but add an entry to the host file so yum can't access that server. The fastest-mirror plugin will see it timeout and look for a better mirror.

The other option is to change the repository file to not point at the general mirrors addresses but instead to point at one specific mirror.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .