Score:6

Ubuntu kernel upgrade to 6.2.0-26 failed

pm flag

3 edits with further information at the bottom of this question.

When I routinely upgraded to the latest generic kernel, the upgrade failed and stopped my computer booting. I had to do a zfs rollback to recover. It had created a vmlinuz-6.2.0-26-generic but no initrd.img file. I have plenty of space in my boot directory (622208 kb). When I tried to install the package, I got dpkg errors:

dave@dave-X570:~$ sudo apt-get install linux-image-generic
[sudo] password for dave: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  linux-image-6.2.0-26-generic
The following NEW packages will be installed
  linux-image-6.2.0-26-generic linux-image-generic
0 to upgrade, 2 to newly install, 0 to remove and 1 not to upgrade.
Need to get 14.3 MB of archives.
After this operation, 14.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mirror.ox.ac.uk/sites/archive.ubuntu.com/ubuntu lunar-updates/main amd64 linux-image-6.2.0-26-generic amd64 6.2.0-26.26 [14.3 MB]
Get:2 http://mirror.ox.ac.uk/sites/archive.ubuntu.com/ubuntu lunar-updates/main amd64 linux-image-generic amd64 6.2.0.26.26 [8,224 B]
Fetched 14.3 MB in 1s (10.9 MB/s)              
Requesting to save current system state
Successfully saved as "autozsys_dfx1su"
Selecting previously unselected package linux-image-6.2.0-26-generic.
(Reading database ... 740023 files and directories currently installed.)
Preparing to unpack .../linux-image-6.2.0-26-generic_6.2.0-26.26_amd64.deb ...
Unpacking linux-image-6.2.0-26-generic (6.2.0-26.26) ...
Selecting previously unselected package linux-image-generic.
Preparing to unpack .../linux-image-generic_6.2.0.26.26_amd64.deb ...
Unpacking linux-image-generic (6.2.0.26.26) ...
Setting up linux-image-6.2.0-26-generic (6.2.0-26.26) ...
I: /boot/vmlinuz is now a symlink to vmlinuz-6.2.0-26-generic
I: /boot/initrd.img is now a symlink to initrd.img-6.2.0-26-generic
Setting up linux-image-generic (6.2.0.26.26) ...
Processing triggers for linux-image-6.2.0-26-generic (6.2.0-26.26) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.2.0-26-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.0-26-generic
grep: /boot/config-6.2.0-26-generic: No such file or directory
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
grep: /boot/config-6.2.0-26-generic: No such file or directory
E: gzip compression (CONFIG_RD_GZIP) not supported by kernel
update-initramfs: failed for /boot/initrd.img-6.2.0-26-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.2.0-26-generic (--configure):
 installed linux-image-6.2.0-26-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-6.2.0-26-generic
ZSys is adding automatic system snapshot to GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is what I ended up with in /boot:

total 175149
-rw-r--r-- 1 root root    275920 Jun 16 14:22 config-6.2.0-25-generic
drwxr-xr-x 3 root root       512 Jan  1  1970 efi
drwxr-xr-x 4 root root       512 Jan  1  1970 efi2
drwxr-xr-x 4 root root       512 Jan  1  1970 efi3
drwxr-xr-x 6 root root         9 Jul 30 15:17 grub
lrwxrwxrwx 1 root root        27 Jul 30 15:06 initrd.img -> initrd.img-6.2.0-26-generic
-rw-r--r-- 1 root root 147970001 Jul 12 21:37 initrd.img-6.2.0-25-generic
lrwxrwxrwx 1 root root        27 Jul 30 14:39 initrd.img.old -> initrd.img-6.2.0-25-generic
-rw-r--r-- 1 root root    138712 Feb 11 10:16 memtest86+ia32.bin
-rw-r--r-- 1 root root    139776 Feb 11 10:16 memtest86+ia32.efi
-rw-r--r-- 1 root root    144312 Feb 11 10:16 memtest86+x64.bin
-rw-r--r-- 1 root root    145408 Feb 11 10:16 memtest86+x64.efi
-rw------- 1 root root   8163660 Jun 16 14:22 System.map-6.2.0-25-generic
lrwxrwxrwx 1 root root        24 Jul 30 15:06 vmlinuz -> vmlinuz-6.2.0-26-generic
-rw------- 1 root root  13854600 Jun 16 16:47 vmlinuz-6.2.0-25-generic
-rw------- 1 root root  14482632 Jul 10 21:31 vmlinuz-6.2.0-26-generic
lrwxrwxrwx 1 root root        24 Jul 30 14:39 vmlinuz.old -> vmlinuz-6.2.0-25-generic

I am running Kubuntu 23.04 on root ZFS. But if that was the problem, I would have expected a dkms error. Why didn't the install generate a /boot/config-6.2.0-26-generic or an initrd.img-6.2.0-26-generic?

Update

I then copied config-6.2.0-25-generic to config-6.2.0-26-generic as update-initramfs hadn't created it. Then when I ran sudo update-initramfs -v -c -k 6.2.0-26-generic it created /boot/initrd.img-6.2.0-26-generic. I then ran update-grub and rebooted.

On rebooting, it started to boot 6.2.0-26 but didn't complete. Booting from 6.2.0-25 worked.

I noticed a major difference part way through the boot process. When it recognised the two displays connected, it started echoing the boot process lines to my second screen and reduced the font size on my main 4K screen. That must have happened after the AMD graphics driver started working and identified the screens. But that did not happen with the 6.2.0-26 initrd image.

Update 2

I removed 6.2.0-26 and carried on running 6.2.0-25 for a while. Then when I did an apt upgrade of linux-firmware, it ran dkms and generated a new kernel image for 6.2.0-25. That did not reboot. I had to use zfs rollback to go back to a working kernel.

So it looks like there is something wrong in the dkms process. I ran dkms status and got this report.

dave@dave-X570:/boot$ sudo dkms status
[sudo] password for dave: 
fwts-efi-runtime-dkms/23.01.00, 5.19.0-41-generic, x86_64: installed (WARNING! Diff between built and installed module!)
fwts-efi-runtime-dkms/23.01.00, 6.2.0-20-generic, x86_64: installed (WARNING! Diff between built and installed module!)
fwts-efi-runtime-dkms/23.01.00, 6.2.0-23-generic, x86_64: installed (WARNING! Diff between built and installed module!)
fwts-efi-runtime-dkms/23.01.00, 6.2.0-24-generic, x86_64: installed (WARNING! Diff between built and installed module!)
fwts-efi-runtime-dkms/23.01.00, 6.2.0-25-generic, x86_64: installed (WARNING! Diff between built and installed module!)
fwts-efi-runtime-dkms/23.01.00, 6.2.0-26-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 5.19.0-41-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 6.2.0-20-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 6.2.0-23-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 6.2.0-24-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 6.2.0-25-generic, x86_64: installed (WARNING! Diff between built and installed module!)
v4l2loopback/0.12.7, 6.2.0-26-generic, x86_64: installed (WARNING! Diff between built and installed module!)
zfs/2.1.9, 6.2.0-23-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
zfs/2.1.9, 6.2.0-24-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
zfs/2.1.9, 6.2.0-25-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)
zfs/2.1.9, 6.2.0-26-generic, x86_64: installed (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!) (WARNING! Diff between built and installed module!)

update 3

kernel 6.2.0-27 installed, producing a config-6.2.0-27-generic and an initrd.img-6.2.0-27-generic. But the reboot failed. So I rebooted into 6.2.0-25-generic.

On comparing journalctl -b -1 | grep amdgpu against journalctl -b 0 | grep amdgpu I discovered that there were no amdgpu lines in the 6.2.0-27 boot.

That means initramfs hadn't included the amdgpu firmware or modules in initrd.img-6.2.0-27-generic

zwets avatar
us flag
What happened when you tried a second time?
David Newman avatar
pm flag
It happened again and again, every time. I went back to the previous state,then reinstalled and got the same problem.
Score:6
co flag

After all attempts (including reinstalling Ubuntu several times), using Linux 6.2.0-26-generic with drivers nvidia-driver-535 or xserver-xorg-video-nouveau caused this issue.

I did the last install without internet. It booted with Linux 5.19.0-32-generic version without any problems. With the sudo apt update && sudo apt upgrade -y command, the Linux 6.2.0-26-generic version was automatically installed. After the restart, the computer did not boot again. I selected Linux 5.19.0-32-generic version again at boot and it booted without any problem. I installed the nvidia-driver-525 driver from the Additional Drivers tab in the Software & Updates application. When I restarted the computer, the Linux 6.2.0-26-generic version was successfully opened.

Maybe these steps will solve your problem too.

PS: I'm using Ubuntu 22.04.2 LTS on my desktop. I have Ryzen 7 3500 CPU and Gigabyte RTX 3060 Ti 8GB GPU

David Newman avatar
pm flag
Thank you, but that specific solution doesn't help me as I have an AMD Radeon card, not an Nvidea one. The AMD drivers and firmware are open source and included in Linux distributions. So the problem is how to get the correct AMD Radeon firmware integrated into the kernel image with dkms.
Dominux avatar
mx flag
Thanks pal, I thought the same way but wasn't sure till I checked the same specs and conditions of your case with mine
surfingonthenet avatar
ua flag
It works for me. Thank you. The driver name is "Using NVIDIA driver metapackage from nvidia-driver-535 (proprietary, tested)"
Score:2
in flag

Im reporting the same issue as @o.mora on ubuntu 22.04.2 LTS on Asus Nitro 5 (Intel i7 , NVIDIA RTX 3060 6GB GPU).

The issue was solved booting with Linux 5.19.0-32 generic and changing nvidia driver from Nouveau to nvidia server driver 525.Then restarting with 6.2.0-26 worked right.

Score:1
so flag

I faced the same issue. Solved by actually booting into previous 5.xx using "additional options" menu from Grub.

Then I went straight to drivers and changed the nvidia driver to nvidia-driver-525, reboot and done. Quite simple to solve once you know what it is.

Score:1
tr flag
Van

I, too, had a problem with my Ubuntu 22.04.3 LTS not booting after upgrading to kernel 6.2.0-26-generic (via apt dist-upgrade). I found the OP's post describing my issue and @O. Mora's response:

After all attempts (including reinstalling Ubuntu several times), using Linux 6.2.0-26-generic with drivers nvidia-driver-535 or xserver-xorg-video-nouveau caused this issue.

So I rebooted using my previous kernel (5.19.0-50-generic) and discovered I was indeed using the xserver-xorg-video-nouveau instead of the NVIDIA driver. I'm not sure how the video driver got rolled back. I re-installed the NVIDIA driver metapackage from nvidia-driver-525 (proprietary), rebooted, and kernel 6.2.0-26-generic is working fine now.

FYI: I am running an AMD 5800 with an NVIDIA 3080 12GB.

Score:1
pm flag

Finally I fixed the problem by deleting /etc/modprobe.d/blacklist-amdgpu.conf, then doing an update-initramfs -u -v -c 6.2.0-27-generic, followed by update-grub and a reboot.

After narrowing down the problem to initramfs not installing amdgpu modules, I did a search on that and found other examples where modules had been blacklisted. Removing the blacklist fixed the problem.

I think that blacklist file was installed when I tried (and failed) to install the AMD proprietory drivers.

Score:0
cn flag

Invalid Grub Config

Symptom

I got that error as well:

dpkg: error processing package linux-image-6.2.0-27-generic (--configure):
 installed linux-image-6.2.0-27-generic package post-installation script subprocess returned error exit status 1

In my case it was an invalid grub config. I noticed this when I ran sudo apt autoremove it resulted in.

...
Do you want to continue? [Y/n] y
(Reading database ... 316368 files and directories currently installed.)
Removing linux-image-6.2.0-25-generic (6.2.0-25.25) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.2.0-25-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 12: /etc/default/grub: cpufreq.default_governor=ondemand: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
...

Please notice this line: /usr/sbin/grub-mkconfig: 12: /etc/default/grub: cpufreq.default_governor=ondemand: not found

I remembered that I messed around with the CPU Governor and did not revert my grub config from a not working solution.

Resolution

I removed the invalid line from my grub-config:

cpufreq.default_governor=ondemand    # I removed this line

And ran sudo update-grub. And now everything works just fine. My case might be very rare, but I hope pointing this out may help people to save some time.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.