First I did a Konsole OS Updates instead of the GUI:
sudo apt update & sudo apt upgrade
Here is partial list of the slew of errors it spit out:The following NEW packages will be installed:
linux-headers-6.17.0-14-generic linux-hwe-6.17-headers-6.17.0-14 linux-hwe-6.17-tools-6.17.0-14
linux-image-6.17.0-14-generic linux-modules-6.17.0-14-generic
linux-modules-extra-6.17.0-14-generic linux-tools-6.17.0-14-generic
....
N: Ignoring file 'ubuntu.sources.save.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'ubuntu.sources.save.2' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Some packages may have been kept back due to phasing.
Highlighted Errors:
Cleaning build area...
make -j8 KERNELRELEASE=6.17.0-14-generic KVER=6.17.0-14-generic...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.17.0-14-generic (x86_64)
Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more information.
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed
...
Building module:
Cleaning build area...
make -j8 KERNELRELEASE=6.17.0-14-generic -C /lib/modules/6.17.0-14-generic/build M=/var/lib/dkms/vi
rtualbox/7.0.16/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.17.0-14-generic (x86_64)
Consult /var/lib/dkms/virtualbox/7.0.16/build/make.log for more information.
dkms autoinstall on 6.17.0-14-generic/x86_64 failed for broadcom-sta(10) virtualbox(10)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
* dkms: autoinstall for kernel 6.17.0-14-generic
...fail!
...
dpkg: error processing package linux-headers-6.17.0-14-generic (--configure):
installed linux-headers-6.17.0-14-generic package post-installation script subprocess returned error exit status 11
Setting up libglib2.0-dev:amd64 (2.80.0-6ubuntu3.8) ...
dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-24.04:
linux-headers-generic-hwe-24.04 depends on linux-headers-6.17.0-14-generic; however:
Package linux-headers-6.17.0-14-generic is not configured yet.
dpkg: error processing package linux-headers-generic-hwe-24.04 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up linux-hwe-6.17-tools-6.17.0-14 (6.17.0-14.14~24.04.1) ...
dpkg: dependency problems prevent configuration of linux-generic-hwe-24.04:
linux-generic-hwe-24.04 depends on linux-headers-generic-hwe-24.04 (= 6.17.0-14.14~24.04.1); howev
er:
Package linux-headers-generic-hwe-24.04 is not configured yet.
dpkg: error processing package linux-generic-hwe-24.04 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous f
ailure.
...
Building module:
Cleaning build area...
make -j8 KERNELRELEASE=6.17.0-14-generic KVER=6.17.0-14-generic...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/broadcom-sta-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.17.0-14-generic (x86_64)
Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more information.
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed
Building module:
Cleaning build area...
make -j8 KERNELRELEASE=6.17.0-14-generic -C /lib/modules/6.17.0-14-generic/build M=/var/lib/dkms/vi
rtualbox/7.0.16/build...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.17.0-14-generic (x86_64)
Consult /var/lib/dkms/virtualbox/7.0.16/build/make.log for more information.
dkms autoinstall on 6.17.0-14-generic/x86_64 failed for broadcom-sta(10) virtualbox(10)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
* dkms: autoinstall for kernel 6.17.0-14-generic
...fail!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.17.0-14-generic (--configure):
installed linux-image-6.17.0-14-generic package post-installation script subprocess returned error
exit status 11
Errors were encountered while process
ing:
linux-headers-6.17.0-14-generic
linux-headers-generic-hwe-24.04
linux-generic-hwe-24.04
linux-image-6.17.0-14-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
[1]+ Stopped
It was clear to me that I had to ditch Kernel 6.17.So i did a list of the available kernels:
dpkg -l | grep linux-image
ii linux-image-6.14.0-36-generic 6.14.0-36.36~24.04.1 amd64 Signed kernel image generic
ii linux-image-6.14.0-37-generic 6.14.0-37.37~24.04.1 amd64 Signed kernel image generic
iF linux-image-6.17.0-14-generic 6.17.0-14.14~24.04.1 amd64 Signed kernel image generic
ii linux-image-generic-hwe-24.04 6.17.0-14.14~24.04.1 amd64 Generic Linux kernel image
Then I booted into Refind and ensured that Kernel 6.17 was gone.
I now boot from the ‘old’ Kernel 6.14.0-37.
I will have to pay attention if any future OS Updates contain a newer Kernel & do a backup up first in case I encounter another Kernel Panic.
Small Rant: I have been using ubuntu for about 15 years now, and it is absolutely the greatest. However, this is my second encounter of a Kernel Panic in 4 months. An OS that is so brilliant should be able to do better if it encounters a problem with a newer Kernel, say so, and allow us to boot an older one. Don’t just blurt out Kernel Panic and halt. End Rant
(Just a question : is it normal after purging that grub cannot be accessed at startup anymore? System is booting directly into 6.14.0-37 which is fine.)
When I boot I always go into Refind and this awesome utility allows me to boot various Kernels.
The problem is that when I get a Kernel Panic, I’m stuck at that front end screen - I don’t know how to bypass the Blasted Kernel Panic screen.
So what I did was boot with a USB and restore. Fortunately I do a backup every few days so it’s all good.
Now I just have to wait and see if a newer Kernel will work for me. I don’t know how to report this to the boys/girls that give us the OS Updates. They should be made aware of this.
I’m going to see if I can Post some sort of bug report. I know it’s not a bug, but as I said above, it shouldn’t just halt. If the new Kernel won’t boot, give us the option to boot another Kernel.
An OS update brought in Kernel 6.17.0-14 (I was running 6.14.0-37). Ubuntu Unity 24.04
A boot gave me a Kernel Panic screen. Fortunately I was able to boot a USB, and restore from a 3 day old backup. At this point I am running just fine, but I have to be careful re future ‘OS Updates’, and if there is a new Kernel to be installed, I will do a backup FIRST!.
This is not a question or a bug - just a sensible SUGGESTION. If a kernel can’t boot, don’t halt. Rather give us an option to boot with another one of the backup kernels that reside on the system. That would sure save a lot of grief.
Thank you, this was basically the solution for me as well. One minor note that I think is particular to my setup (I have an Nvidia gpu and for some reason sudo apt-get purge linux-image-6.17.0-14-generic ended up giving me an error as some kind nvidia related module started auto building after I issued the aforementioned purge command.
it handled all the rest of the purges and for some reason the Nvidia related module didn’t start to auto build. Hope this helps someone else in case they have the same issue.
This effectively already exists. It’s your GRUB screen.
If you get a kernel panic: Simply reboot, expose your GRUB screen, and select an older kernel.
If you ARE using Ubuntu repository software, soon a routine kernel package update will fix the problem automatically for you. Until then, keep using the older kernel.
If you are NOT using Ubuntu repository software, plan to uninstall or replace that software. It is no longer compatible with Ubuntu.
There’s generally no need to remove packages. Indeed, that will prevent the fixed packages from reaching you. Doing so will also make it harder for support volunteers to help you effectively. And, in a few months, your current kernel will cease getting security updates.
1 thing I learned after >15 years using ubuntu :
never never never purge kernel versions after a kernel panic screen. Just use grub (where it is meant for) to select the previous kernel and wait patient for a solution.
Hi, thx, when I run your apt list command, I get the following : (something is wrong I think) :
awk: 1: unexpected character 0xe2
awk: line 2: missing } near end of file
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.