I'm running a standard Ubuntu 22.04 desktop, installed from the amd64 USB image. Nothing unusual other than having the Nvidia binary driver for my GPU to power dual monitors.
Installed updates a couple of days ago, shut down at the end of the day and power on the next morning - only one screen comes on and it takes around 10 seconds for X to start, it's normally almost immediate and when investigating I find I'm using the nouveau driver instead of Nvidia. Reboot, use grub to choose another kernel, notice linux-image-6.2.0-xx-gcp is the default kernel and there are loads of other platform specific kernels of various versions installed:
linux-image-5.15.0-1029-nvidia/jammy-updates,jammy-security,now 5.15.0-1029.29 amd64 [installed,automatic]
linux-image-5.15.0-1036-intel-iotg/jammy-updates,jammy-security,now 5.15.0-1036.41 amd64 [installed,automatic]
linux-image-5.15.0-1038-gcp/jammy-updates,jammy-security,now 5.15.0-1038.46 amd64 [installed,automatic]
linux-image-5.15.0-1039-oracle/jammy-updates,jammy-security,now 5.15.0-1039.45 amd64 [installed,automatic]
linux-image-5.15.0-1040-aws/jammy-updates,jammy-security,now 5.15.0-1040.45 amd64 [installed,automatic]
linux-image-5.15.0-78-generic/jammy-updates,jammy-security,now 5.15.0-78.85 amd64 [installed,automatic]
linux-image-5.15.0-78-lowlatency/jammy-updates,jammy-security,now 5.15.0-78.85 amd64 [installed,automatic]
linux-image-5.17.0-1035-oem/jammy-updates,jammy-security,now 5.17.0-1035.36 amd64 [installed,automatic]
linux-image-5.19.0-1014-nvidia-lowlatency/jammy-updates,jammy-security,now 5.19.0-1014.14 amd64 [installed,automatic]
linux-image-5.19.0-1014-nvidia/jammy-updates,jammy-security,now 5.19.0-1014.14 amd64 [installed,automatic]
linux-image-5.19.0-1027-gcp/jammy-updates,jammy-security,now 5.19.0-1027.29~22.04.1 amd64 [installed,automatic]
linux-image-5.19.0-1027-oracle/jammy-updates,jammy-security,now 5.19.0-1027.30 amd64 [installed,automatic]
linux-image-5.19.0-1029-aws/jammy-updates,jammy-security,now 5.19.0-1029.30~22.04.1 amd64 [installed,automatic]
linux-image-5.19.0-1030-lowlatency/jammy-updates,jammy-security,now 5.19.0-1030.30 amd64 [installed,automatic]
linux-image-5.19.0-50-generic/jammy-updates,jammy-security,now 5.19.0-50.50 amd64 [installed,automatic]
linux-image-6.0.0-1020-oem/jammy-updates,jammy-security,now 6.0.0-1020.20 amd64 [installed,automatic]
linux-image-6.1.0-1017-oem/jammy-updates,jammy-security,now 6.1.0-1017.17 amd64 [installed,automatic]
linux-image-6.2.0-1003-nvidia/jammy-updates,jammy-security,now 6.2.0-1003.3~22.04.1+1 amd64 [installed,automatic]
linux-image-6.2.0-1008-aws/jammy-updates,jammy-security,now 6.2.0-1008.8~22.04.1 amd64 [installed,automatic]
linux-image-6.2.0-1009-lowlatency/jammy-updates,jammy-security,now 6.2.0-1009.9~22.04.1 amd64 [installed,automatic]
linux-image-6.2.0-1010-gcp/jammy-updates,jammy-security,now 6.2.0-1010.10~22.04.1 amd64 [installed,automatic]
linux-image-6.2.0-26-generic/jammy-updates,jammy-security,now 6.2.0-26.26~22.04.1 amd64 [installed,automatic]
linux-image-generic/jammy-updates,jammy-security,now 5.15.0.78.75 amd64 [installed]
I choose another kernel from grub menu, one screen is blank but backlit and can't I switch between VTs. The other screen doesn't come on at all. Forcibly reboot and go round in circles choosing various kernels and getting either one working display or none before realising the lowest common denominator is 5.15.0-78-generic, which boots and after installing the linux-image-generic metapackage and nvidia-driver-535, reboots giving me dual screens using the Nvidia driver again.
I've no idea why all these kernel variants got installed, I didn't do it myself. I think some packaging bug pulled them all in as dependencies but when I try to remove them, apt insists on installing the -unsigned versions of each instead. I did also find the -hwe kernels installed but managed to remove them manually and the -azure kernels which I managed to uninstall after removing linux-base-sgx. I can't find any forum threads or bugs that mention anyone else is having this issue.
I've tried going back through the apt logs and using apt-rdepends to work out what is pulling these kernels in but I still can't figure it out and I can't remove them. I have the following in my apt history.log from the upgrade where all of these kernels appeared:
Start-Date: 2023-07-26 09:54:25
Commandline: packagekit role='install-packages'
Requested-By: adam (1000)
Install: linux-image-5.15.0-1042-azure:amd64 (5.15.0-1042.49, automatic), libnvidia-common-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-objects-nvidia-525-6.2.0-1009-lowlatency:amd64 (6.2.0-1009.9~22.04.1, automatic), linux-objects-nvidia-525-6.1.0-1017-oem:amd64 (6.1.0-1017.17, automatic), linux-objects-nvidia-525-6.2.0-1003-nvidia:amd64 (6.2.0-1003.3~22.04.1+2, automatic), linux-image-5.19.0-1027-oracle:amd64 (5.19.0-1027.30, automatic), libnvidia-fbc1-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), libnvidia-fbc1-535:i386 (535.54.03-0ubuntu0.22.04.1, automatic), linux-modules-5.15.0-1039-oracle:amd64 (5.15.0-1039.45, automatic), linux-modules-5.17.0-1035-oem:amd64 (5.17.0-1035.36, automatic), linux-modules-5.19.0-1027-gcp:amd64 (5.19.0-1027.29~22.04.1, automatic), libnvidia-gl-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), libnvidia-gl-535:i386 (535.54.03-0ubuntu0.22.04.1, automatic), linux-signatures-nvidia-5.19.0-50-generic:amd64 (5.19.0-50.50, automatic), linux-signatures-nvidia-6.2.0-1010-gcp:amd64 (6.2.0-1010.10~22.04.1, automatic), linux-modules-5.19.0-1014-nvidia-lowlatency:amd64 (5.19.0-1014.14, automatic), linux-objects-nvidia-525-5.19.0-1030-lowlatency:amd64 (5.19.0-1030.30, automatic), linux-modules-5.15.0-1038-gcp:amd64 (5.15.0-1038.46, automatic), linux-modules-nvidia-535-5.19.0-50-generic:amd64 (5.19.0-50.50, automatic), linux-modules-5.19.0-1029-aws:amd64 (5.19.0-1029.30~22.04.1, automatic), linux-signatures-nvidia-5.19.0-1014-nvidia-lowlatency:amd64 (5.19.0-1014.14, automatic), linux-signatures-nvidia-5.19.0-1010-nvidia-lowlatency:amd64 (5.19.0-1010.10, automatic), libnvidia-extra-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-objects-nvidia-525-5.15.0-1029-nvidia:amd64 (5.15.0-1029.29, automatic), linux-signatures-nvidia-6.1.0-1017-oem:amd64 (6.1.0-1017.17, automatic), nvidia-compute-utils-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), nvidia-driver-535:amd64 (535.54.03-0ubuntu0.22.04.1), linux-modules-6.2.0-1008-azure:amd64 (6.2.0-1008.8~22.04.1, automatic), dctrl-tools:amd64 (2.24-3build2, automatic), linux-image-5.19.0-1014-nvidia-lowlatency:amd64 (5.19.0-1014.14, automatic), linux-image-5.19.0-1010-nvidia-lowlatency:amd64 (5.19.0-1010.10, automatic), linux-signatures-nvidia-5.15.0-1036-intel-iotg:amd64 (5.15.0-1036.41, automatic), libnvidia-encode-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), libnvidia-encode-535:i386 (535.54.03-0ubuntu0.22.04.1, automatic), linux-signatures-nvidia-5.19.0-1014-nvidia:amd64 (5.19.0-1014.14, automatic), linux-objects-nvidia-525-5.19.0-1014-nvidia:amd64 (5.19.0-1014.14, automatic), linux-objects-nvidia-525-6.2.0-26-generic:amd64 (6.2.0-26.26~22.04.1, automatic), nvidia-utils-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-image-6.2.0-1008-azure:amd64 (6.2.0-1008.8~22.04.1, automatic), linux-signatures-nvidia-5.15.0-1042-azure:amd64 (5.15.0-1042.49, automatic), linux-signatures-nvidia-6.2.0-1008-aws:amd64 (6.2.0-1008.8~22.04.1, automatic), xserver-xorg-video-nvidia-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-image-5.15.0-1040-aws:amd64 (5.15.0-1040.45, automatic), linux-modules-5.19.0-1030-lowlatency:amd64 (5.19.0-1030.30, automatic), linux-modules-5.19.0-1010-nvidia-lowlatency:amd64 (5.19.0-1010.10, automatic), linux-image-6.2.0-1003-nvidia:amd64 (6.2.0-1003.3~22.04.1+1, automatic), linux-objects-nvidia-525-5.15.0-78-generic:amd64 (5.15.0-78.85, automatic), linux-modules-5.19.0-1027-oracle:amd64 (5.19.0-1027.30, automatic), linux-image-5.19.0-1030-lowlatency:amd64 (5.19.0-1030.30, automatic), linux-objects-nvidia-525-5.15.0-1040-aws:amd64 (5.15.0-1040.45, automatic), linux-modules-5.15.0-1042-azure:amd64 (5.15.0-1042.49, automatic), libnvidia-decode-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), libnvidia-decode-535:i386 (535.54.03-0ubuntu0.22.04.1, automatic), linux-image-6.2.0-1010-gcp:amd64 (6.2.0-1010.10~22.04.1, automatic), linux-objects-nvidia-535-5.19.0-50-generic:amd64 (5.19.0-50.50, automatic), nvidia-firmware-535-535.54.03:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-signatures-nvidia-5.15.0-1039-oracle:amd64 (5.15.0-1039.45, automatic), linux-objects-nvidia-525-5.15.0-1039-oracle:amd64 (5.15.0-1039.45, automatic), linux-signatures-nvidia-5.15.0-1040-aws:amd64 (5.15.0-1040.45, automatic), linux-image-5.17.0-1035-oem:amd64 (5.17.0-1035.36, automatic), nvidia-kernel-common-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-modules-6.2.0-1009-lowlatency:amd64 (6.2.0-1009.9~22.04.1, automatic), linux-image-6.0.0-1020-oem:amd64 (6.0.0-1020.20, automatic), linux-objects-nvidia-525-5.15.0-78-lowlatency:amd64 (5.15.0-78.85+1, automatic), linux-image-5.15.0-1038-gcp:amd64 (5.15.0-1038.46, automatic), linux-signatures-nvidia-5.19.0-1027-oracle:amd64 (5.19.0-1027.30, automatic), linux-objects-nvidia-525-5.15.0-1036-intel-iotg:amd64 (5.15.0-1036.41, automatic), linux-modules-nvidia-535-generic-hwe-22.04:amd64 (5.19.0-50.50), linux-signatures-nvidia-6.2.0-1003-nvidia:amd64 (6.2.0-1003.3~22.04.1+2, automatic), linux-modules-5.15.0-78-lowlatency:amd64 (5.15.0-78.85, automatic), linux-objects-nvidia-525-6.2.0-1008-azure:amd64 (6.2.0-1008.8~22.04.1, automatic), linux-image-6.2.0-1009-lowlatency:amd64 (6.2.0-1009.9~22.04.1, automatic), linux-image-5.15.0-78-generic:amd64 (5.15.0-78.85, automatic), linux-signatures-nvidia-6.2.0-1009-lowlatency:amd64 (6.2.0-1009.9~22.04.1, automatic), linux-image-6.2.0-1008-aws:amd64 (6.2.0-1008.8~22.04.1, automatic), linux-objects-nvidia-525-5.15.0-1038-gcp:amd64 (5.15.0-1038.46, automatic), linux-modules-6.2.0-26-generic:amd64 (6.2.0-26.26~22.04.1, automatic), linux-image-5.15.0-1029-nvidia:amd64 (5.15.0-1029.29, automatic), linux-image-5.15.0-78-lowlatency:amd64 (5.15.0-78.85, automatic), linux-image-6.1.0-1017-oem:amd64 (6.1.0-1017.17, automatic), linux-signatures-nvidia-6.2.0-26-generic:amd64 (6.2.0-26.26~22.04.1, automatic), linux-base-sgx:amd64 (4.5ubuntu9, automatic), linux-image-6.2.0-26-generic:amd64 (6.2.0-26.26~22.04.1, automatic), linux-modules-6.2.0-1003-nvidia:amd64 (6.2.0-1003.3~22.04.1, automatic), linux-image-5.19.0-1027-gcp:amd64 (5.19.0-1027.29~22.04.1, automatic), linux-modules-5.15.0-1029-nvidia:amd64 (5.15.0-1029.29, automatic), linux-signatures-nvidia-5.15.0-1038-gcp:amd64 (5.15.0-1038.46, automatic), linux-modules-6.2.0-1010-gcp:amd64 (6.2.0-1010.10~22.04.1, automatic), linux-signatures-nvidia-5.15.0-78-lowlatency:amd64 (5.15.0-78.85+1, automatic), linux-modules-5.15.0-1036-intel-iotg:amd64 (5.15.0-1036.41, automatic), linux-image-5.19.0-1029-aws:amd64 (5.19.0-1029.30~22.04.1, automatic), linux-image-5.19.0-1014-nvidia:amd64 (5.19.0-1014.14, automatic), linux-objects-nvidia-525-5.19.0-1027-oracle:amd64 (5.19.0-1027.30, automatic), linux-signatures-nvidia-5.19.0-1030-lowlatency:amd64 (5.19.0-1030.30, automatic), linux-modules-6.0.0-1020-oem:amd64 (6.0.0-1020.20, automatic), linux-objects-nvidia-525-6.2.0-1010-gcp:amd64 (6.2.0-1010.10~22.04.1, automatic), linux-signatures-nvidia-5.15.0-78-generic:amd64 (5.15.0-78.85, automatic), linux-objects-nvidia-525-5.19.0-1014-nvidia-lowlatency:amd64 (5.19.0-1014.14, automatic), linux-modules-5.19.0-1014-nvidia:amd64 (5.19.0-1014.14, automatic), linux-objects-nvidia-525-5.19.0-1010-nvidia-lowlatency:amd64 (5.19.0-1010.10, automatic), linux-objects-nvidia-525-5.19.0-50-generic:amd64 (5.19.0-50.50, automatic), linux-image-5.15.0-1036-intel-iotg:amd64 (5.15.0-1036.41, automatic), libnvidia-cfg1-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-objects-nvidia-525-5.17.0-1035-oem:amd64 (5.17.0-1035.36, automatic), linux-objects-nvidia-525-5.19.0-1027-gcp:amd64 (5.19.0-1027.29~22.04.1+5, automatic), linux-modules-5.15.0-1040-aws:amd64 (5.15.0-1040.45, automatic), nvidia-kernel-source-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), linux-objects-nvidia-525-6.0.0-1020-oem:amd64 (6.0.0-1020.20, automatic), linux-objects-nvidia-525-5.19.0-1029-aws:amd64 (5.19.0-1029.30~22.04.1, automatic), libnvidia-compute-535:amd64 (535.54.03-0ubuntu0.22.04.1, automatic), libnvidia-compute-535:i386 (535.54.03-0ubuntu0.22.04.1, automatic), linux-signatures-nvidia-5.15.0-1029-nvidia:amd64 (5.15.0-1029.29, automatic), linux-modules-6.2.0-1008-aws:amd64 (6.2.0-1008.8~22.04.1, automatic), linux-signatures-nvidia-5.17.0-1035-oem:amd64 (5.17.0-1035.36, automatic), linux-signatures-nvidia-6.0.0-1020-oem:amd64 (6.0.0-1020.20, automatic), linux-signatures-nvidia-5.19.0-1027-gcp:amd64 (5.19.0-1027.29~22.04.1+5, automatic), linux-signatures-nvidia-5.19.0-1029-aws:amd64 (5.19.0-1029.30~22.04.1, automatic), linux-objects-nvidia-525-6.2.0-1008-aws:amd64 (6.2.0-1008.8~22.04.1, automatic), linux-modules-6.1.0-1017-oem:amd64 (6.1.0-1017.17, automatic), linux-objects-nvidia-525-5.15.0-1042-azure:amd64 (5.15.0-1042.49, automatic), dkms:amd64 (2.8.7-2ubuntu2.2, automatic), linux-modules-5.15.0-78-generic:amd64 (5.15.0-78.85, automatic), linux-image-5.15.0-1039-oracle:amd64 (5.15.0-1039.45, automatic), linux-signatures-nvidia-6.2.0-1008-azure:amd64 (6.2.0-1008.8~22.04.1, automatic)
I've had to tell grub to boot my running kernel by default from now on and I'll have to manually select the newest 5.15.0-xx-generic kernel in the grub menu each time I get a kernel update until I can remove all those unnecessary kernels.
Can anybody help me figure out how to remove them?