Mrepo – How to keep old version

yum

I have a local yum repo that is updated via mrepo / createrepo, all my servers are targeting this local repo for their updates but it's always installing the last version which isn't good for a production environment.

I'd like to implement a procedure to control which version of packages are authorized to be pulled by clients. So I'd need to have multiple versions of packages.

I tried the following parameters in /etc/mrepo.conf, but I still see packages being removed due to newer revision during a 'mrepo -uvvg'

mirrordir-cleanup = no
reposync-cleanup = no
reposync-newest-only = no
rhnget-cleanup = no
rhnget-download-all = yes
rsync-cleanup = no

/etc/mrepo.d/centos.conf :

[centos6]
name = CentOS Repo $release ($arch)
release = 6
arch = x86_64
metadata = repomd repoview yum

### Additional repositories
centos6 = http://mirror.csclub.uwaterloo.ca/centos/$release/os/$arch/
centos6-updates=http://mirror.csclub.uwaterloo.ca/centos/$release/updates/$arch/

Best Answer

You are not syncing from RHN, so the "rhnget" options aren't doing any thing for you. Instead, I think you need lftp-cleanup = no when mirroring HTTP sources.

Also, instead of issuing yum update or yum install package, you can be more precise by requesting specific versions.

yum install httpd-2.2.15-9.el6

This is probably what you want to do for a production environment.

Client side, you could also use the Yum plugin, versionlock, if there are specific packages you need to version control, but you want to update others liberally.


EDIT:

I spent some time looking at this on our mrepo server for my own curiosity. The default behavior of lftp is to mirror the remote host. Could you provide the output showing that packages are being removed during mrepo -ug?

The notes in the example documentation show that lftp-cleanup is for:

## Clean up packages that are not on the sending side ?

So, it seems my hunch could be correct (although for the wrong reason.) My bet is that the upstream source is not archiving packages and your default lftp-cleanup value is yes. You should confirm also that the packages are still available at the source.