Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 :-)

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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?

share|improve this answer
    
/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 '09 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 '09 at 18:11

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.