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

Is it possible to specify a mirror for YUM to target when doing updates? I've noticed on my CentOS 6.2 servers that it takes up to a minute for YUM to respond from a given command. I did some Googling and found that YUM reads from a timedhosts.txt file, so I viewed the contents and it was pretty nasty. There were 49 lines, 32 of which had a value of 99999999999, which I assume to be a timeout.

There has to be a way for me to specify a mirror I know would be lightning fast (being from SoCal I would like to use http://mirrors.usc.edu/.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

There is nothing stopping you from disabling the default repos and adding an entry that points to the specific server you want to use. For example:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.usc.edu/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1

[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.usc.edu/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
share|improve this answer

Do you have the fastest-mirror plugin installed? centos wiki You could edit the base link, in /etc/yum.repos.d/CentOS-Base.repo, to reflect the repo you would like. I am not sure this is best though.similiar to how this was done with the local repo

share|improve this answer
    
Nice. Looks like I'm not the only one. Came across the following when I googled for 'centos yum disable cache hostfile': dbaglobe.com/2009/12/… Gonna try it, if it works I'll accept. –  Mike Purcell Mar 1 '12 at 2:16

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.