Thursday, November 05, 2009

Automated YUM Update

Most Linux machines use a derivative of the YUM update utility to install software and patch systems. I've been working with virtual appliances lately and have several VMs with very low memory and disk foot prints that can't handle a full update. I'll kickstart the box, and when I try to run an up2date, the process crashes for lack of space.

Here's a little script to solve the problem:
for J in `echo {a..z}`; do echo "Doing $J..."; \
yum update -y "$J*"; yum clean packages; done
It cycles through letters a to z, updates that letter and its dependencies, then removes the downloads. Once its finished, its best to run the full update command to grab packages that start with numbers... and that notorious piece of crap NetworkManager, which starts with a cap.

Oh, and I don't care that this technique is slow.

No comments:

Post a Comment