equivalent commands in ubuntu

KUPI

New Member
Joined
Aug 30, 2019
Messages
29
Reaction score
5
Credits
222
Hello Everyone,

We have RHEL, SLES in our environment.
Now we have got few ubuntu 20.04 servers. We are going to patch the ubuntu servers.
I would like to know, how do we find the available kernel versions.

in RHEL, "yum list kernel" will list the installed and available kernel list.
Do we have similar commands in ubuntu.
 
Last edited:


Hello Everyone,

We have RHEL, SLES in our environment.
Now we have got few ubuntu 20.04 servers. We are going to patch the ubuntu servers.
I would like to know, how do we find the available kernel versions.

in RHEL, "yum list kernel" will list the installed and available kernel list.
Do we have similar commands in ubuntu.
Commands are available for the output of both installed and available kernels.

Examples of commands to show installed kernels follow:
Code:
$ ls /boot | grep vmlinuz
vmlinuz-6.10.3-amd64
vmlinuz-6.10.6-amd64
vmlinuz-6.9.10-amd64
vmlinuz-6.9.12-amd64
vmlinuz-6.9.7-amd64
vmlinuz-6.9.9-amd64


$ apt list --installed | grep linux-image-[[:digit:]]

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-image-6.10.3-amd64/now 6.10.3-1 amd64 [installed,local]
linux-image-6.10.6-amd64/testing,now 6.10.6-1 amd64 [installed,automatic]
linux-image-6.9.10-amd64/now 6.9.10-1 amd64 [installed,local]
linux-image-6.9.12-amd64/now 6.9.12-1 amd64 [installed,local]
linux-image-6.9.7-amd64/now 6.9.7-1 amd64 [installed,local]
linux-image-6.9.9-amd64/now 6.9.9-1 amd64 [installed,local]


$ dpkg --get-selections | grep linux-image-[[:digit:]]
linux-image-6.10.3-amd64                        install
linux-image-6.10.6-amd64                        install
linux-image-6.9.10-amd64                        install
linux-image-6.9.12-amd64                        install
linux-image-6.9.7-amd64                         install
linux-image-6.9.9-amd64                         install


$ dpkg -l | grep linux-image-[[:digit:]]
ii  linux-image-6.10.3-amd64                                 6.10.3-1                                                amd64        Linux 6.10 for 64-bit PCs (signed)
ii  linux-image-6.10.6-amd64                                 6.10.6-1                                                amd64        Linux 6.10 for 64-bit PCs (signed)
ii  linux-image-6.9.10-amd64                                 6.9.10-1                                                amd64        Linux 6.9 for 64-bit PCs (signed)
ii  linux-image-6.9.12-amd64                                 6.9.12-1                                                amd64        Linux 6.9 for 64-bit PCs (signed)
ii  linux-image-6.9.7-amd64                                  6.9.7-1                                                 amd64        Linux 6.9 for 64-bit PCs (signed)
ii  linux-image-6.9.9-amd64                                  6.9.9-1                                                 amd64        Linux 6.9 for 64-bit PCs (signed)

Examples to show available kernels follow, but note that the package: linux-image-amd64, is a metapackage in debian based systems, so has no version number and is not itself a kernel wherever it appears in output. In general, a linux-image* package name without a version number is not itself a kernel but a metapackage.

Code:
$ apt list linux-image*
linux-image-6.10.3-amd64/now 6.10.3-1 amd64 [installed,local]
linux-image-6.10.6-amd64-dbg/testing 6.10.6-1 amd64
linux-image-6.10.6-amd64-unsigned/testing 6.10.6-1 amd64
linux-image-6.10.6-amd64/testing,now 6.10.6-1 amd64 [installed,automatic]
linux-image-6.10.6-cloud-amd64-dbg/testing 6.10.6-1 amd64
linux-image-6.10.6-cloud-amd64-unsigned/testing 6.10.6-1 amd64
linux-image-6.10.6-cloud-amd64/testing 6.10.6-1 amd64
linux-image-6.10.6-rt-amd64-dbg/testing 6.10.6-1 amd64
linux-image-6.10.6-rt-amd64-unsigned/testing 6.10.6-1 amd64
linux-image-6.10.6-rt-amd64/testing 6.10.6-1 amd64
linux-image-6.9.10-amd64/now 6.9.10-1 amd64 [installed,local]
linux-image-6.9.12-amd64/now 6.9.12-1 amd64 [installed,local]
linux-image-6.9.7-amd64/now 6.9.7-1 amd64 [installed,local]
linux-image-6.9.9-amd64/now 6.9.9-1 amd64 [installed,local]
linux-image-amd64-dbg/testing 6.10.6-1 amd64
linux-image-amd64-signed-template/testing 6.10.6-1 amd64
linux-image-amd64/testing,now 6.10.6-1 amd64 [installed]
linux-image-cloud-amd64-dbg/testing 6.10.6-1 amd64
linux-image-cloud-amd64/testing 6.10.6-1 amd64
linux-image-rt-amd64-dbg/testing 6.10.6-1 amd64
linux-image-rt-amd64/testing 6.10.6-1 amd64


$ apt-cache pkgnames linux-image
linux-image-6.10.6-cloud-amd64
linux-image-6.9.7-amd64
linux-image-rt-amd64-dbg
linux-image-amd64-signed-template
linux-image-6.10.6-amd64-unsigned
linux-image-amd64-dbg
linux-image-6.9.9-amd64
linux-image-6.10.6-cloud-amd64-dbg
linux-image-6.10.6-rt-amd64
linux-image-6.10.6-amd64-dbg
linux-image-amd64
linux-image-cloud-amd64-dbg
linux-image-6.9.10-amd64
linux-image-6.10.6-rt-amd64-unsigned
linux-image-6.10.6-rt-amd64-dbg
linux-image-6.10.6-cloud-amd64-unsigned
linux-image-rt-amd64
linux-image-6.10.6-amd64
linux-image-6.10.3-amd64
linux-image-cloud-amd64
linux-image-6.9.12-amd64
 
Last edited:
If you want to see what the upgrade command is going to do:

sudo apt update && sudo apt upgrade -s

That should do the trick to show you which kernel (if any) is to be installed when you run the upgrade commands.
 

Members online


Top