1

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:

[base] name=CentOS-$releasever - Base baseurl=ftp://user:[email protected]/centos/locked/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 [updates] name=CentOS-$releasever - Updates baseurl=ftp://user:[email protected]/centos/locked/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 [extras] name=CentOS-$releasever - Extras baseurl=ftp://user:[email protected]/centos/locked/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 
2
  • is this the only file in /etc/yum/repos.d? Commented Aug 4, 2013 at 5:52
  • No there are others, for epel, percona, remi. Commented Aug 4, 2013 at 16:06

1 Answer 1

2

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.

3
  • 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. Commented Aug 4, 2013 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. Commented Aug 4, 2013 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. Commented Aug 5, 2013 at 20:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.