I've got a batch machines to update this week, but I'm not quite confident with our established procedure. It basically runs like so for each machine:
- Mount a shared directory particular to the OS version/bitness, ie:
mount -t cifs //server/share/rhel5.3-64/ /mnt/updates/
yum update --downloadonly --downloaddir=/mnt/updates/
yum update /mnt/updates/*.rpm
We use the mount to reduce the amount of network bandwidth we use up, but since each machine might have wildly different package sets installed there will be packages included in the 'update' command that are not even present on the system, as well as there being multiple older versions of certain packages.
Is this a problem? Will yum skip/remove any unnecessary/obsolete packages before applying the changes?
After reading @aaron-copley's response I decided to do a bit of testing. I logged onto the server, mounted the share, ran
yum update --downloadonly --downloaddir=/mnt/updates/, unmounted the share, did a
yum clean all, remounted, and re-ran the command. Nothing downloaded. [yay]
I deleted an rpm, ran the command again, and only that one package downloaded. [also yay]
I mounted the share on another box running the same RHEL version, ran
yum update --downloadonly --downloaddir=/mnt/updates/, and even though it's marked 221 packages for download, it's only downloading the 30 that were not already in the share. [super yay]
As a bonus, yum also lists the packages that are already downloaded in bold.