While upgrading from 22.10 to 23.04, I ran into this bug which made the system unbootable because the newest kernel 6.2.0-20
has not been installed correctly.
I used the GRUB startup menu to define an older kernel (apparently, 5.19.0-41
is the only one available "behind" the newest 6.2.0-20
), so now I run on this older kernel.
To cleanup my system I tried to apt remove linux-headers-6.2.0-20
and all other 6.2.0-20
-related headers of the new and broken kernel, but this was not possible because the unspecific linux-headers-generic
depended on those packages.
So I also removed linux-headers-generic
with the plan to re-install it once I removed the problematic headers. I manually purged all of those new headers until the list was pretty much empty (I left linux-libc-dev:amd64
because it seemed this was not causing problems):
$ sudo dpkg -l | grep "6.2.0-20"
pi linux-headers-6.2.0-20 6.2.0-20.20 all Header files related to Linux kernel version 6.2.0
rc linux-image-6.2.0-20-generic 6.2.0-20.20 amd64 Signed kernel image generic
ii linux-libc-dev:amd64 6.2.0-20.20 amd64 Linux Kernel Headers for development
rc linux-modules-6.2.0-20-generic 6.2.0-20.20 amd64 Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
rc linux-modules-extra-6.2.0-20-generic 6.2.0-20.20 amd64 Linux kernel extra modules for version 6.2.0 on 64 bit x86 SMP
But now, when apt install linux-headers-generic
it will still try to install the newest headers alongside it:
$ sudo apt install linux-headers-generic
Die folgenden zusätzlichen Pakete werden installiert:
linux-headers-6.2.0-20 linux-headers-6.2.0-20-generic
Now I wonder, how does the system determine that it will install a newer kernel when installing the general linux-headers-generic
and can I somehow reset this to the older kernel?