I've read a few guides outlining how to setup a local YUM repo, but none of them explicitly stated an answer to my question; If I set up a local YUM repo, does that mean that any CentOS servers which pull from said repo will never be "ahead" of the local YUM repo?

I want to ensure a consistent package distribution across all my servers. Right now, when I do a yum update, even on a daily basis, the servers can be out of alignment. For example if I run YUM update on my dev server in the morning, then run YUM update on one of my production servers in the afternoon, the production server may have picked up a new version of a package that the dev server did not pick up, due to the time window between the update commands.

Rather, I'd prefer that I run yum update from my dev server which has access to remote upstream yum repos, then let it sit for 2 weeks, after which I run yum update on my production servers against the local repo on my dev server.


Provided you disable updating/installing from the upstream repo, yes.

  • From your response I can infer that there is a setting to disable updating from upstream, yet pulling packages from local yum repo? – Mike Purcell Mar 21 '12 at 22:09
  • Right. Add a .repo file for the local repo, and set enabled=0 in the upstream .repo. – Ignacio Vazquez-Abrams Mar 21 '12 at 22:10
  • You happen to know a link to tutorial to set up a local centos repo? The ones I am reading keep talking about having to rsync all the remote centos files, I'd rather just push out the files on the server acting as the local centos repo. If a client tries to install a package not available on local repo, it simply fails. – Mike Purcell Mar 22 '12 at 22:49
  • @Mike: Just run createrepo against the directory containing the packages, optionally passing -g if you have a comps.xml for supporting package groups. – Ignacio Vazquez-Abrams Mar 23 '12 at 5:16
  • Can you add a better, step-by-step explanation of how I would get other servers to pull from a single server's existing package repo? All the tutorials I find whilst googling all talk about copying packages from the source dvd/cd, seems to me I should be able to use the source server's currently installed packages as the source. – Mike Purcell Jul 20 '12 at 17:56

You could create separate directories for Prod and Dev. You sync from upstream into Dev only. Then periodically symlink/hardlink new packages from the Dev to Prod dir. Run createrepo on all the dirs, but point Prod servers to the Prod repo only.

You could also have multiple levels apart from Dev/Prod, and a designated period for moving packages from one level to another. That way, all servers in that time period are consistent.

Perhaps something like mrepo may help you in the process. Also pulp hit version 1.0.

  • Thanks man, I will check these out. I just want to make sure that my production boxes don't pull down an upstream app that hasn't been tested on dev env yet. – Mike Purcell Mar 27 '12 at 23:16
  • Ideally, you should also manage the yum repo configs on the servers with puppet or chef. – Not Now Mar 28 '12 at 0:33
  • Ya, I would if I had the time. Having to wear the sysadmin hat right now b/c no budget for a systems guy. – Mike Purcell Mar 28 '12 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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