How to stop 16.04.2 with HWE kernel from updating to 4.4 kernels

I ran the following a week ago to upgrade from 16.04.1 to 16.04.2 with HWE:

sudo apt install --install-recommends xserver-xorg-hwe-16.04

It installed a 4.8 kernel which I'm running now. Just now, I ran the following:

sudo apt update && sudo apt dist-upgrade

This installed the 4.4.0-62-generic kernel and made that the kernel that will be booted into, I think, because it's pointed to by /initrd.img and /vmlinuz. How do I stop future updates of the 4.4 kernel series and set the kernel that will be booted into next time back to the 4.8 kernel series?


Solution 1:

I encountered this this morning, fortunately I stopped it before it installed the new kernel. The HWE instructions should have covered this IMHO.

To prevent future problems of this nature, just delete the linux-generic entries. Until you do this, you will have two sets of packages that can be updated with different kernels.

sudo apt remove linux-generic linux-headers-generic linux-image-generic

Future kernel updates will come through the linux-generic-hwe-16.04 package.

Solution 2:

If you manually choose desired kernel, it wont reverse it back. So far 4.8 HWE was installed as dependency, as far as I understad. Try:

$ sudo apt-get install linux-image-generic-hwe-16.04

Then you may try dist-upgrade again.