2

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:

  1. Mount a shared directory particular to the OS version/bitness, ie: mount -t cifs //server/share/rhel5.3-64/ /mnt/updates/
  2. yum update --downloadonly --downloaddir=/mnt/updates/
  3. 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?

edit

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.

2 Answers 2

1

Yum will only replace installed packages when used with update. You are correct though, you may not be downloading packages necessary for another system.

What you could do, is use a tool like mrepo to build and maintain a local repository of all Red Hat errata. This system would be sync to RHN and maintain all packages on the local network. Each system then points to this host internally for updates to reduce WAN bandwidth consumption. You also wouldn't have to mess with mounts, you could use Yum over HTTP.

mrepo: Yum/Apt repository mirroring (fka yam)

5
  • The yum update --downloadonly command is run on each machine before the installation, so each machine should have all of the necessary rpms. My concern was that extra or obsolete packages might have been installed on a machine that didn't need them. From what I've heard so far, this shouldn't be an issue.
    – Sammitch
    Jan 9, 2013 at 19:44
  • Got it, I misunderstood what you meant. You aren't saving any bandwidth then, I don't believe. You are downloading the same packages over and over. Take a look at mrepo if you're interested. Jan 9, 2013 at 20:48
  • Oh, lame. I guess I'll just do a simple yum update on each machine and look into mrepo for the next patch cycle.
    – Sammitch
    Jan 9, 2013 at 21:01
  • Actually, it's not downloading anything extra. I've updated my posting with my testing notes.
    – Sammitch
    Jan 9, 2013 at 23:05
  • Great! I wasn't 100% sure, but it looked like it would. Jan 10, 2013 at 14:47
1

Yum only install newer version of packages. You could use createrepo package for creating repository with updates and fill config file /etc/yum.repos.d/company-updates.repo with content:

[rhel-company-updates]
name=RHEL-company-updates
baseurl=file:///mnt/updates/
gpgcheck=0
enabled=1

The procedure simplifies:

# mount -t cifs //server/share/rhel5.3-64/ /mnt/updates/
# yum update

Btw, next step to optimize is to use autofs with cifs for automount /mnt/updates/ when a yum attempts to access this folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .