cancel
Showing results for 
Search instead for 
Did you mean: 
vsolodkyi
Sisense Team Member
Sisense Team Member

Some OS related issues could be fixed by installing a different Linux Kernel. In this article we will review how to install a new kernel and make it bootable by default.

Installing a new kernel

  1. Display version of currently running Kernel: uname -r  Example output: 4.15.0-76-generic
  2. List available for installation kernels: sudo apt update && sudo apt list linux-*image-* or sudo apt update && sudo apt search linux-*image-*  Example output: 

Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease

Hit:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease

Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease

Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease

Hit:5 https://download.docker.com/linux/ubuntu bionic InRelease

Get:6 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8993 B]

Err:6 https://packages.cloud.google.com/apt kubernetes-xenial InRelease

  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05

Fetched 8993 B in 3s (2751 B/s)

Reading package lists... Done

Building dependency tree       

Reading state information... Done

298 packages can be upgraded. Run 'apt list --upgradable' to see them.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.cloud.google.com/apt kubernetes-xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05

W: Failed to fetch https://apt.kubernetes.io/dists/kubernetes-xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05

W: Some index files failed to download. They have been ignored, or old ones used instead.

Listing... Done

linux-image-4.15.0-1004-oem/bionic 4.15.0-1004.5+signed1 amd64

linux-image-4.15.0-1005-dell300x/bionic-updates 4.15.0-1005.8 amd64

linux-image-4.15.0-1006-dell300x/bionic-updates,bionic-security 4.15.0-1006.10 amd64

linux-image-4.15.0-1006-gcp/bionic 4.15.0-1006.6 amd64

linux-image-4.15.0-1006-oem/bionic-updates,bionic-security 4.15.0-1006.9 amd64

linux-image-4.15.0-1007-aws/bionic 4.15.0-1007.7 amd64

linux-image-4.15.0-1007-dell300x/bionic-updates,bionic-security 4.15.0-1007.11 amd64

linux-image-4.15.0-1007-oracle/bionic-updates 

4.15.0-1007.9+signed1 amd64

linux-image-4.15.0-1008-gcp/bionic-updates,bionic-security 4.15.0-1008.8 amd64

linux-image-4.15.0-1008-kvm/bionic 4.15.0-1008.8 amd64

linux-image-4.15.0-1008-oem/bionic-updates,bionic-security 4.15.0-1008.11 amd64

linux-image-4.15.0-1008-oracle/bionic-updates,bionic-security 4.15.0-1008.10 amd64

linux-image-4.15.0-1009-aws/bionic-updates,bionic-security 4.15.0-1009.9 amd64

linux-image-4.15.0-1009-azure/bionic 4.15.0-1009.9 amd64

linux-image-4.15.0-1009-dell300x/bionic-updates,bionic-security 4.15.0-1009.13 amd64

linux-image-4.15.0-1009-gcp/bionic-updates,bionic-security 4.15.0-1009.9 amd64

linux-image-4.15.0-1009-oem/bionic-updates,bionic-security 4.15.0-1009.12 amd64

linux-image-4.15.0-1009-oracle/bionic-updates,bionic-security 4.15.0-1009.11 amd64

linux-image-4.15.0-101-generic/bionic-updates,bionic-security 4.15.0-101.102 amd64

linux-image-5.4.0-125-generic/bionic-updates,bionic-security 5.4.0-125.141~18.04.1 amd64

linux-image-5.4.0-125-lowlatency/bionic-updates,bionic-security 5.4.0-125.141~18.04.1 amd64

linux-image-5.4.0-126-generic/bionic-updates,bionic-security 5.4.0-126.142~18.04.1 amd64

linux-image-5.4.0-126-lowlatency/bionic-updates,bionic-security 5.4.0-126.142~18.04.1 amd64

linux-image-5.4.0-128-generic/bionic-updates,bionic-security 5.4.0-128.144~18.04.1 amd64

linux-image-5.4.0-128-lowlatency/bionic-updates,bionic-security 5.4.0-128.144~18.04.1 amd64

linux-image-5.4.0-131-generic/bionic-updates,bionic-security 5.4.0-131.147~18.04.1 amd64

linux-image-5.4.0-131-lowlatency/bionic-updates,bionic-security 5.4.0-131.147~18.04.1 amd64

linux-image-5.4.0-132-generic/bionic-updates,bionic-security 5.4.0-132.148~18.04.1 amd64

linux-image-5.4.0-132-lowlatency/bionic-updates,bionic-security 5.4.0-132.148~18.04.1 amd64

linux-image-5.4.0-135-generic/bionic-updates,bionic-security 5.4.0-135.152~18.04.2 amd64

linux-image-5.4.0-135-lowlatency/bionic-updates,bionic-security 5.4.0-135.152~18.04.2 amd64

linux-image-5.4.0-136-generic/bionic-updates,bionic-security 5.4.0-136.153~18.04.1 amd64

linux-image-5.4.0-136-lowlatency/bionic-updates,bionic-security 5.4.0-136.153~18.04.1 amd64

linux-image-5.4.0-137-generic/bionic-updates,bionic-security 5.4.0-137.154~18.04.1 amd64

linux-image-5.4.0-137-lowlatency/bionic-updates,bionic-security 5.4.0-137.154~18.04.1 amd64

linux-image-unsigned-5.4.0-1058-oracle/bionic-updates,bionic-security 5.4.0-1058.62~18.04.1 amd64

linux-image-unsigned-5.4.0-1059-azure/bionic-updates,bionic-security 5.4.0-1059.62~18.04.1 amd64

linux-image-unsigned-5.4.0-1059-gcp/bionic-updates,bionic-security 5.4.0-1059.63~18.04.1 amd64

linux-image-unsigned-5.4.0-1059-gke/bionic-updates,bionic-security 5.4.0-1059.62~18.04.1 amd64

linux-image-unsigned-5.4.0-1059-oracle/bionic-updates,bionic-security 5.4.0-1059.63~18.04.1 amd64

linux-image-unsigned-5.4.0-1060-gcp/bionic-updates,bionic-security 5.4.0-1060.64~18.04.1 amd64

linux-image-unsigned-5.4.0-1061-aws/bionic-updates,bionic-security 5.4.0-1061.64~18.04.1 amd64

linux-image-unsigned-5.4.0-1061-azure/bionic-updates,bionic-security 5.4.0-1061.64~18.04.1 amd64

linux-image-unsigned-5.4.0-1061-gke/bionic-updates,bionic-security 5.4.0-1061.64~18.04.1 amd64

linux-image-unsigned-5.4.0-1061-oracle/bionic-updates,bionic-security 5.4.0-1061.65~18.04.1 amd64

linux-image-unsigned-5.4.0-1062-azure/bionic-updates,bionic-security 5.4.0-1062.65~18.04.1 amd64

linux-image-unsigned-5.4.0-1062-gcp/bionic-updates,bionic-security 5.4.0-1062.66~18.04.1 amd64

linux-image-unsigned-5.4.0-1062-gke/bionic-updates,bionic-security 5.4.0-1062.65~18.04.1 amd64

linux-image-unsigned-5.4.0-1062-oracle/bionic-updates,bionic-security 5.4.0-1062.66~18.04.1 amd64

linux-image-unsigned-5.4.0-1063-aws/bionic-updates,bionic-security 5.4.0-1063.66~18.04.1 amd64

linux-image-unsigned-5.4.0-1063-azure/bionic-updates,bionic-security 5.4.0-1063.66~18.04.1 amd64

linux-image-unsigned-5.4.0-1063-gcp/bionic-updates,bionic-security 5.4.0-1063.67~18.04.1 amd64

linux-signed-image-oracle-edge/bionic-updates,bionic-security 5.4.0.1092.101~18.04.66 amd64

linux-signed-image-oracle-lts-18.04/bionic-updates,bionic-security 4.15.0.1113.118 amd64

From the output we can see different types of kernels which could be used under different circumstances. It is also not recommended to use unsigned kernels.  

Let’s imagine that the fix for our issue is contained in linux-image-5.4.0-137-generic kernel. 

2. Install selected kernel with sudo apt install linux-image-5.4.0-137-generic It will take some time to install, however successful run should be ended with done.

3. Check installed kernels with dpkg --list | grep linux-image     Example output:  

hi  linux-image-4.15.0-76-generic         4.15.0-76.86                                    amd64        Signed kernel image generic

ii  linux-image-5.4.0-137-generic         5.4.0-137.154~18.04.1                           amd64        Signed kernel image generic

ii  linux-image-generic                   4.15.0.76.78                                    amd64        Generic Linux kernel image

We can see our new kernel in the list now. 

 

Booting system with a new kernel

To activate a new kernel we should reboot the machine and select a newly installed kernel, however in case if we don’t have access to the bare metal or hypervisor we can manually “hardcode” the new kernel in GRUB.

Please note that it could be dangerous and the system can get stuck at the load, so be sure that you have all backups and snapshots created before the procedure. 

  1. We need to find a few entrances from /boot/grub/grub.cfg :
  • Get the $menuentry_id_option with grep submenu /boot/grub/grub.cfg 

Example output: submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66' {

Here 'gnulinux-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66'  is what we are looking for.

  • Get the specific kernel option with grep gnulinux-5.4.0 /boot/grub/grub.cfg 

Example output: menuentry 'Ubuntu, with Linux 5.4.0-137-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-137-generic-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66' {

menuentry 'Ubuntu, with Linux 5.4.0-137-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.0-137-generic-recovery-88f56154-7603-4a3f-86d1-5ed1459cef66' {

Here 'gnulinux-5.4.0-137-generic-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66' is what we are looking for.  

2. Set GRUB_DEFAULT in /etc/default/grub/

  • Join two previously obtained strings by ‘>’, for GRUB_DEFAULT variable. Example:  GRUB_DEFAULT=’gnulinux-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66>gnulinux-5.4.0-137-generic-advanced-88f56154-7603-4a3f-86d1-5ed1459cef66

3. Update GRUB with sudo update-grub

4. Reboot the machine - now the system should boot up with a new kernel. In case of any errors please revert back all changes using the snapshot or grub-rescue CLI. 


 

Version history
Last update:
‎03-02-2023 10:15 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email community@sisense.com