Q. I know how to find out current running kernel version under CentOS Enterprise Linux 4.6 x86_64, but how do I find out latest available kernel version? How do I find out if it’s the latest one? How to find the latest release version for package called xyz or kernel package?

A. You can simply use yum command to find out more about latest version available under your CentOS system. To list all packages with updates available in the yum repositories.

yum list updates syntax

Use the following syntax and you are allowed to use wild cards (the single quotes will keep your shell from expanding the globs):
yum list updates {package-name}
yum list updates 'package-name*'
yum list updates '*package-name*'

For example, find out if latest updated version of kernel or php package, enter:
# yum list updates 'php*'
# yum list updates 'kernel*'
Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
Skipping security plugin, no data
Updated Packages
kernel.i686                              2.6.18-53.1.21.el5     updates    

You can list currently installed package version by typing any one of the following command:
# rpm -q kernel
# yum list installed 'kernel*'
Or you can list multiple packages on separated by whitespace:
# yum list installed 'kernel*' 'php*'
Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Installed Packages
kernel.i686                              2.6.18-53.1.4.el5      installed       
kernel.i686                              2.6.18-53.1.19.el5     installed       
kernel.i686                              2.6.18-53.1.21.el5     installed       
kernel.i686                              2.6.18-53.1.6.el5      installed       
kernel.i686                              2.6.18-8.1.15.el5      installed       
kernel-devel.i686                        2.6.18-8.1.15.el5      installed       
kernel-devel.i686                        2.6.18-53.1.4.el5      installed       
kernel-devel.i686                        2.6.18-53.1.6.el5      installed       
kernel-devel.i686                        2.6.18-53.1.19.el5     installed       
kernel-devel.i686                        2.6.18-53.1.21.el5     installed       
kernel-headers.i386                      2.6.18-53.1.21.el5     installed

Finally, you can apply updated version using yum command itself:
# yum update kernel.i686
Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Skipping security plugin, no data
Resolving Dependencies
Skipping security plugin, no data
--> Populating transaction set with selected packages. Please wait.
---> Package kernel.i686 0:2.6.18-53.1.21.el5 set to be installed
--> Running transaction check

Dependencies Resolved

 Package                 Arch       Version          Repository        Size 
 kernel                  i686       2.6.18-53.1.21.el5  updates            13 M

Transaction Summary
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 13 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: kernel                       ######################### [1/1] 

Installed: kernel.i686 0:2.6.18-53.1.21.el5

Don’t forget to reboot your system so that you can boot into latest kernel version:
# reboot

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • yoander Jun 17, 2008 @ 13:17

    You can get more info about a package typing

    rpm -qi package-name

  • shujoy das Jul 12, 2009 @ 18:25

    Notify me when upgrade pakages are available

  • Andy Boyd Feb 18, 2016 @ 23:25

    This is obvious, but you will get this confusing error on AWS boxes if you try to run yum commands while not root. Just something to check.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum