yum update with shared cache

Sammitch asked:

We’ve got a big batch of RHEL6 machines that are due for patching, and for some reason the process here does not involve a local repo. I’m new here, I’ve asked why, [“it just didn’t work”] and I don’t have enough time to make it work before the window that’s already scheduled.

So the usual method is to install yum-downloadonly and run yum update --downloadonly --downloaddir=/mnt/cifs_share and then yum update /mnt/cifs_share/*.rpm which just does not look right to me since not all of these machines have the same set of installed packages.

The method I tried today was mounting the share to /var/cache/yum/x86_64/6Server/rhel-x86_64-server-6/packages/ which worked, but then yum automatically deleted everything once it finished.

I’ve looked over the yum man page, but I don’t see any flag I can feed it to stop it from deleting everything, nor a flag like up2date’s --tmpdir=/mnt/cifs_share.

Can anyone out there help me kludge this together until I can get a local repository working?

My answer:


Add this line to /etc/yum.conf:

keepcache=1

This will cause yum to leave the downloaded packages in place after installation.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.