70

Red Hat docs say:

To see which installed packages on your system have updates available, use the following command:

yum check-update

What command must I run to view all available versions for a package installed on my system?

Example: yum check-update tells me java6 update #43 is available, but what if I want update #40?

2 Answers 2

59

This command won't focus specifically on one package, but by using a regex to do the matching you can still see what's available:

$ yum list available java\*
java-1.4.2-gcj-compat.i386                                                   1.4.2.0-40jpp.115                                                      installed
java-1.6.0-openjdk.i386                                                      1:1.6.0.0-1.36.1.11.9.el5_9                                            installed
Available Packages
java-1.4.2-gcj-compat-devel.i386                                             1.4.2.0-40jpp.115                                                      base     
java-1.4.2-gcj-compat-javadoc.i386                                           1.4.2.0-40jpp.115                                                      base     
java-1.4.2-gcj-compat-src.i386                                               1.4.2.0-40jpp.115                                                      base     
java-1.6.0-openjdk.i386                                                      1:1.6.0.0-1.40.1.11.11.el5_9                                           updates  
java-1.6.0-openjdk-demo.i386                                                 1:1.6.0.0-1.40.1.11.11.el5_9

You can make it "smarter" by filtering the output using grep.

4
  • Then I can run yum update <package-name> provided the package, to which I'm trying to upgrade, is, in fact, a higher version of my currently installed package? May 15, 2013 at 19:05
  • That would be correct. You can update to the next version from what you currently have installed.
    – slm
    May 15, 2013 at 19:08
  • 1
    Note that the official repositories very rarely carry more than one version of a package, old packages are obsoleted for a reason.
    – vonbrand
    May 15, 2013 at 20:03
  • You want to use --show-duplicates to see all the versions, but as vonbrand said if you are using CentOS/Fedora you only get the latest anyway (If you pay for actual RHEL, you'll get a lot of choice and may want to look at the upgrade-to command as well). May 17, 2013 at 18:30
13

To see currently installed package version + check what is the latest available version, use --showduplicates list <package name>, for example:

$ sudo yum --showduplicates list 'tar.*'

Loaded plugins: search-disabled-repos
Installed Packages
tar.x86_64   2:1.26-32.el7    installed              
Available Packages
tar.x86_64   2:1.26-29.el7    rhelosp-rhel-7.4-server
tar.x86_64   2:1.26-31.el7    rhelosp-rhel-7.4-server
tar.x86_64   2:1.26-32.el7    rhelosp-rhel-7.4-server
1
  • --showduplicates is exactly what I was looking for.
    – RonJohn
    Feb 25, 2022 at 20:13

You must log in to answer this question.

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