yum list installed kernel will return a list of packages and their current version:

Installed Packages
kernel.x86_64    3.10.0-693.5.2.el7    updates

yum update kernel gives you a list of packages being updated, and their new versions:

 Package     Arch    Version              Repository  Size
 kernel      x86_64  3.10.0-957.21.3.el7  updates     48 M

Is there a combination using yum I can run to list the current differences in versions for packages being updated similar to this?

Package         Old version          Update version
kernel.x86_64   3.10.0-693.5.2.el7   3.10.0-957.21.3.el7

the 'Resolving Dependencies' output does this, but the readability is not great, and difficult to separate from the rest of the text. Plus if you specify a single package, it only lists the existing version for the dependencies:

yum update kernel
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-957.21.3.el7 will be installed
--> Processing Dependency: linux-firmware >= 20180911-68 for package: kernel-3.10.0-957.21.3.el7.x86_64
--> Running transaction check
---> Package linux-firmware.noarch 0:20170606-56.gitc990aae.el7 will be updated
---> Package linux-firmware.noarch 0:20180911-69.git85c5d90.el7 will be an update
  • I've never heard of any way to do this with yum itself, and I suspect you're probably the first person who ever wanted to. – Michael Hampton Jul 9 '19 at 19:49
  • it would be useful for status reports, or to compare against vuln reports. I've used tools like puppet in a different environment, which is very clear when changing something from [current] to [future]. Where I'm at now, I'm a bit more limited. – user19702 Jul 9 '19 at 20:15
  • 1
    yum history will give you this information, for every installation and update ever done, but the version numbers are still on separate lines. I haven't heard of anyone ever needing them to be on the same line. – Michael Hampton Jul 9 '19 at 20:21

yum doesn't have exactly that output. history shows all transactions and can undo them, list installed shows current version, and update shows the new packages to be installed after dependency resolution.

Write a yum plugin that prints the output you want if you like. However, a person at the prompt is tedious and doesn't scale.

Consider instead enabling automatic updates on a schedule. Verification then becomes reviewing the updates in the repo, and verifying host compliance that they are updating. Perhaps spot check a few hosts after an interesting security update is released.

If you care about the previous versions of many hosts over time, a central database for update management is more powerful anyway.

| improve this answer | |
  • yum history info 'id' is close enough to what I was looking for - it's significantly more readable, and alphabetical so I can find the one or two things we need. – user19702 Jul 10 '19 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.