Linux Kernel – Check Installed and Switch Boot Kernel

See Installed Kernels

In Debian & Ubuntu, we can see the installed kernels with:

% dpkg --list | grep linux-image
ii  linux-image-3.16.0-4-amd64             3.16.51-3                                   amd64        Linux 3.16 for 64-bit PCs
ii  linux-image-3.16.0-6-amd64             3.16.56-1+deb8u1                            amd64        Linux 3.16 for 64-bit PCs
ii  linux-image-4.9.0-11-amd64             4.9.189-3                                   amd64        Linux 4.9 for 64-bit PCs
ii  linux-image-amd64             

In Fedora / CentOS / RedHat / RHEL:

%rpm -qa kernel
kernel-3.10.0-514.6.1.el7.x86_64
kernel-3.10.0-229.el7.x86_64
kernel-3.10.0-229.7.2.el7.x86_64

Switching Kernels With GRUB

The easiest / cleanest way to switch kernels is to select from among the installed kernels at boot time using the GRand Unified Bootloader, GRUB.   By default, though, you may find GRUB doesn’t remember your last kernel selection & then you find yourself re-selecting every time.  Annoying.   Fix this:

% cd /etc/default
% vim grub

We want to make sure these 2 lines exist in this file:

GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

If you have a line like this:

GRUB_DEFAULT=0

You should remove that line so as to have only one GRUB_DEFAULT entry.

So now, when you make your kernel selection at boot time, that selection should work automatically on subsequent boots.

Check out this section of the grub docs for more details.

Sharing is caring!

Leave a Comment

Your email address will not be published. Required fields are marked *


Notice: Undefined index: total_count_position in /var/www/wordpress/wp-content/plugins/social-pug/inc/functions-frontend.php on line 46
shares