12

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?

user68186
  • 33,360
Chai T. Rex
  • 5,193
  • Very timely because @cl-netbox recommended your line 1 to me today and I mentioned there are negative impacts reported in Ask Ubuntu. You should be able to see 4.8 kernels under *Advanced Options* menu in grub but more importantly the highest numbered kernel should always be the default. – WinEunuuchs2Unix Feb 21 '17 at 00:15

2 Answers2

14

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.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • I've tried this, and it stops the kernel, but it doesn't stop the following: The following NEW packages will be installed: linux-tools-4.4.0-65 linux-tools-4.4.0-65-generic. How do I stop those? – Chai T. Rex Mar 02 '17 at 16:37
  • 1
    I don't have any linux-tools* installed, but from messing around in a virtual machine, it looks like you should remove linux-tools-generic and install linux-tools-generic-hwe-16.04. But caveat, I have no experience with this. – Organic Marble Mar 02 '17 at 16:50
  • 1
    It looks like removing those two packages also removed linux-tools-virtual—so I think that's the main package—and installing linux-tools-virtual-hwe-16.04 put in the tools packages for the 4.8 kernel version. – Chai T. Rex Mar 02 '17 at 17:51
  • 1
    FWIW this answer seems to be pretty valid for 18.04 too. – pauldoo Oct 17 '19 at 19:45
1

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.

wk.
  • 600
  • Those commands (install and dist-upgrade) set the HWE kernel package to manually installed, but don't do anything to unset the 4.4 kernel. /initrd.img and /vmlinuz still both point to the 4.4 kernel. – Chai T. Rex Feb 21 '17 at 00:17
  • apt policy linux-generic also still shows as installed with the 4.4 kernel's version. Should I apt remove linux-generic? – Chai T. Rex Feb 21 '17 at 00:20
  • Have you tried to reboot? I suspect that links to right kernel is set somewhere in boot process, because most time you have more than one kernel availabl to boot, but links are not with versions. – wk. Feb 21 '17 at 00:23
  • As removing generic kernel I would not rush with it. And if you ask about linux-generic apt policy tells you aboout linux-generic ;) – wk. Feb 21 '17 at 00:25
  • I rebooted and the 4.8 kernel is running, even though, oddly enough, /initrd.img and /vmlinuz still point to the 4.4 kernel. To make sure this stops future 4.4 downloads, I'm going to see if the next 4.4 kernel update comes in during a future apt update && apt dist-upgrade. – Chai T. Rex Feb 21 '17 at 00:26
  • It is bit weird (linking on 4.4), but no worry here either. I don't see any practical use them on working system. They were used by LILO, but I can't recall any practical use for them now. – wk. Feb 21 '17 at 00:31
  • 1
    @ChaiT.Rex you were on the right track with your comment about removing linux-generic. See my answer. – Organic Marble Feb 21 '17 at 01:09