6

I would like to upgrade to specific kernel version (5.4.0-81-generic) from following current state on different servers. I would like to use apt package manger to update kernel.

Ubuntu 18.04.3 LTS  4.15.0-55-generic
Ubuntu 18.04 LTS    4.15.0-51-generic
Ubuntu 18.04 LTS    4.15.0-20-generic
Ubuntu 18.04 LTS    4.15.0-106-generic
Ubuntu 18.04 LTS    4.15.0-133-generic
Ubuntu 18.04 LTS    4.15.0-140-generic
Ubuntu 18.04 LTS    4.15.0-107-generic
Ubuntu 18.04.4 LTS  5.4.0-74-generic
Ubuntu 18.04.4 LTS  5.4.0-77-generic

ls /boot config-4.15.0-76-generic grub initrd.img-5.4.0-70-generic System.map-5.4.0-70-generic vmlinuz-5.4.0-70-generic config-5.4.0-70-generic initrd.img-4.15.0-76-generic System.map-4.15.0-76-generic vmlinuz-4.15.0-76-generic

uname -r 5.4.0-70-generic

I get following 2 images when try to search for kernel version, which one to use.

apt-cache search linux-image | grep 5.4.0-81-generic
linux-image-5.4.0-81-generic - Signed kernel image generic
linux-image-unsigned-5.4.0-81-generic - Linux kernel image for version 5.4.0 on 64 bit x86 SMP

Now, how to safely, gracefully update only the kernel version -

apt-get upgrade linux-image-5.4.0-81-generic
unknown
  • 99

1 Answers1

5

Warning: doing things below is dangerous if you care about system security. Proceed only if you are sure what do you want to achieve.

So you have to remove meta-package (it usually depends on the latest kernel, nowadays it is 5.4.0-86 in this HWE stack) by

sudo apt-get update
sudo apt-get remove linux-image-generic-hwe-18.04
sudo apt-get autoremove

and then install fixed version by

sudo apt-get install linux-image-5.4.0-81-generic

But please again note that latest kernel is safer, it may have many CVEs fixed. Check changelog for details.

So to get all latest upgrades back you have to execute the following commands:

sudo apt-get update
sudo apt-get install --install-recommends linux-generic-hwe-18.04  
sudo apt-get dist-upgrade # to get all latest dependencies

and then reboot to use all latest software including the kernel.


More stuff to read:

N0rbert
  • 103,263