Manual Update?

When encountering this problem, the first reaction is to manually install the latest version of the kernel:

apt install linux-image-5.15.0-102-generic

After the installation is complete, the new version is used, but this does not seem to solve the problem from the root: if the kernel is updated to 5.15.0-103 next time, wouldn’t I have to do it manually again?

A Glimmer of Hope

While searching for a solution on Google, I accidentally saw this askubuntu Q&A and my eyes lit up. The top answer said that if the Linux kernel-related meta packages are not installed correctly, the upgrade will fail. Although he was solving the HWE kernel upgrade problem, this reminded me: could it be that the reason my machine’s kernel is not upgrading is also because the meta package is not installed?

With this question in mind, I went to check the official Ubuntu-provided kernel-related meta packages. As you can see, it seems we should install the linux-generic package. During the installation process, I found that this meta package would bring in dependencies that are not needed on a virtual machine, such as thermald and usbmuxd.

Further research on another machine running the official Cloud Image revealed the package that should be used: linux-virtual!

root@proxy:~# dpkg --get-selections | grep linux
binutils-x86-64-linux-gnu                       install
console-setup-linux                             install
libselinux1:amd64                               install
linux-base                                      install
linux-headers-5.15.0-101                        install
linux-headers-5.15.0-101-generic                install
linux-headers-5.15.0-102                        install
linux-headers-5.15.0-102-generic                install
linux-headers-generic                           install
linux-headers-virtual                           install
linux-image-5.15.0-101-generic                  install
linux-image-5.15.0-102-generic                  install
linux-image-virtual                             install
linux-modules-5.15.0-101-generic                install
linux-modules-5.15.0-102-generic                install
linux-virtual                                   install
util-linux                                      install

Finally, on these virtual machines that would not automatically upgrade the kernel, running apt install linux-virtual automatically upgraded the kernel to the latest version, and the problem was solved.

Summary

  1. If the kernel-related meta packages are not installed correctly for some reason (such as broken dependencies, accidental uninstallation, etc.), automatic updates can be restored by manually reinstalling them.

  2. When running Ubuntu Server virtual machines in a KVM environment, it is more recommended to use the official Cloud Images directly, rather than installing from a Live CD yourself. Virtual machines installed with a Live CD will install the linux-generic package by default, which may bring in some unnecessary dependencies.