Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've finally gotten around to creating a local mirror, and due to a 'locked' symlink I can now run yum update on all machines and get them to pull the same packages etc so they are all in sync no matter when yum update is run. The problem I am having now is to ensure only the local mirror is used, as yum appears to default to another mirror, even when I use baseurl. Is it possible to lock down the repo config so yum will only pull from specified mirror, even if it's not available?

Example repo conf:

name=CentOS-$releasever - Base

name=CentOS-$releasever - Updates

name=CentOS-$releasever - Extras
share|improve this question
is this the only file in /etc/yum/repos.d? – dawud Aug 4 '13 at 5:52
No there are others, for epel, percona, remi. – Mike Purcell Aug 4 '13 at 16:06
up vote 2 down vote accepted

With no extra plugin like rhnplugin, CentOS will look in /etc/yum.conf and by default all repositories are located under /etc/yum/repos.d. If you edit those files, set enabled directive to 0 under all the repositories you want to disable, ei all repositories who are not your local mirror, run a

yum clean all

and then a

yum repolist

it should display only your local repo.

share|improve this answer
Thanks, I'll give this a shot. The only repo I have enabled by default is the base centos config. I bet the reason why it's default to another mirror is I didn't clear yum cache like you mentioned. – Mike Purcell Aug 4 '13 at 16:08
Clearing the cache worked. Just wish there was something more verbose I could add to the config file to indicate I do not want to try any other mirrors, other than what I specified. – Mike Purcell Aug 4 '13 at 23:46
I don't know why it would try with any other mirror than those specified in the config file, however, if you want to explicitly check weather your custom mirror is OK before trying I don't know if there is such a thing, but writing a yum plugin for it should be simple enough. – Petter H Aug 5 '13 at 20:25

Your Answer


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.