[SOLVED] corrupt install of kernel 5.11

ajstewart_lang

New Member
Joined
Aug 26, 2021
Messages
10
Reaction score
9
Credits
83
Greetings - first time poster so I hope I'm asking my question with sufficient detail. I'm running 20.04 on a Starlabs StarLite laptop. I was running some updates the other day - that look as if they include the 5.11.0-27 kernel and something went wrong. I can't boot into that kernel, although I can still boot into a previous kernel. These are the ones currently on my machine.

Code:
$ dpkg -l | grep linux-image
rH  linux-image-5.11.0-27-generic              5.11.0-27.29~20.04.1                             amd64        Signed kernel image generic
rc  linux-image-5.4.0-26-generic               5.4.0-26.30                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-33-generic               5.4.0-33.37                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-37-generic               5.4.0-37.41                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-39-generic               5.4.0-39.43                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-40-generic               5.4.0-40.44                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-42-generic               5.4.0-42.46                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-45-generic               5.4.0-45.49                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-47-generic               5.4.0-47.51                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-48-generic               5.4.0-48.52                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-51-generic               5.4.0-51.56                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-52-generic               5.4.0-52.57                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-53-generic               5.4.0-53.59                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-54-generic               5.4.0-54.60                                      amd64        Signed kernel image generic
rc  linux-image-5.4.0-56-generic               5.4.0-56.62                                      amd64        Signed kernel image generic
ii  linux-image-5.4.0-58-generic               5.4.0-58.64                                      amd64        Signed kernel image generic
rc  linux-image-5.8.0-36-generic               5.8.0-36.40~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-43-generic               5.8.0-43.49~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-44-generic               5.8.0-44.50~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-45-generic               5.8.0-45.51~20.04.1+1                            amd64        Signed kernel image generic
rc  linux-image-5.8.0-48-generic               5.8.0-48.54~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-49-generic               5.8.0-49.55~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-50-generic               5.8.0-50.56~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-53-generic               5.8.0-53.60~20.04.1                              amd64        Signed kernel image generic
rc  linux-image-5.8.0-55-generic               5.8.0-55.62~20.04.1                              amd64        Signed kernel image generic
rH  linux-image-5.8.0-59-generic               5.8.0-59.66~20.04.1                              amd64        Signed kernel image generic
ii  linux-image-5.8.0-63-generic               5.8.0-63.71~20.04.1                              amd64        Signed kernel image generic

I can't seem to remove the corrupted 5.11 kernel with `sudo apt remove` (nor apt-get purge) as I end up with the following error:

Code:
$ sudo apt remove linux-image-5.11.0-27-generic --verbose-versions
Reading package lists... Done
Building dependency tree      
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
linux-modules-5.11.0-27-generic : Depends: linux-image-5.11.0-27-generic but it is not going to be installed or
                                            linux-image-unsigned-5.11.0-27-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

(nor sudo apt-get purge linux-image-5.11.0-27-generic` produces a similar error related to unmet dependencies.

When I run `apt --fix-broken install` this happens:

Code:
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool libfwupdplugin1 libllvm11 linux-headers-generic-hwe-20.04 shim thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-unsigned-5.11.0-27-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.11-source-5.11.0 linux-hwe-5.11-tools linux-modules-extra-5.11.0-27-generic
The following packages will be REMOVED
  linux-image-5.11.0-27-generic linux-image-5.8.0-59-generic
The following NEW packages will be installed
  linux-image-unsigned-5.11.0-27-generic
0 to upgrade, 1 to newly install, 2 to remove and 0 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/9,927 kB of archives.
After this operation, 9,441 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.11.0-27-generic: dependency problems, but removing anyway as you requested:
linux-modules-5.11.0-27-generic depends on linux-image-5.11.0-27-generic | linux-image-unsigned-5.11.0-27-generic; however:
  Package linux-image-5.11.0-27-generic is to be removed.
  Package linux-image-unsigned-5.11.0-27-generic is not installed.

(Reading database ... 237931 files and directories currently installed.)
Removing linux-image-5.11.0-27-generic (5.11.0-27.29~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.11.0-27-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found background image: wallpaper.png
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.4.0-58-generic
Found initrd image: /boot/initrd.img-5.4.0-58-generic
Adding boot menu entry for UEFI Firmware Settings
/etc/grub.d/35_fwupd: line 5: /usr/share/grub: Is a directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 126
dpkg: error processing package linux-image-5.11.0-27-generic (--remove):
installed linux-image-5.11.0-27-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.11.0-27-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I note I don't have `linux-generic-hwe-20.04` but am not sure if that's related - I can't install it anyway. Neither with the below or with `
sudo apt-get install --install-recommends linux-generic-hwe-20.04

I've been on multiple Linux sites which all seem to suggest that I should be able to (re)install it - but the same dependency issue arises.

Code:
$ sudo apt install linux-generic-hwe-20.04
Reading package lists... Done
Building dependency tree      
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
linux-generic-hwe-20.04 : Depends: linux-image-generic-hwe-20.04 (= 5.11.0.27.29~20.04.11) but it is not going to be installed
linux-modules-5.11.0-27-generic : Depends: linux-image-5.11.0-27-generic but it is not going to be installed or
                                            linux-image-unsigned-5.11.0-27-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

All suggestions as to what I might need to do to fix this would be very much appreciated! I basically want to be able to delete the corrupted 5.11 kernel and reinstall (possibly including linux-generic-hwe-20.04). I kind of feel I'm going round in circles...

EDIT: I do have a Timeshift backup but was thinking it might be good for me (character building even!) to understand how to fix this manually...

thanks

Andrew
 
Last edited:


I had a system do pretty much exactly the same thing - though it's Lubuntu (Ubuntu with some different apps and desktop environment).

I "cheated" and just reverted to an earlier, still maintained, kernel. It's a pretty simple process. To make sure I got it right, I used this:

 
Thanks for your speedy response - when I try `sudo apt install --install-recommends linux-generic-hwe-20.04` I end up back with the unmet dependencies problem (see below). Hmm. Am I running the wrong command? It's not a server installation I want to do but I don't see the desktop command - only commands to downgrade from HWE. Interestingly, `ubuntu-drivers list-oem` hangs - which may or may not be related...

Code:
$ sudo apt install --install-recommends linux-generic-hwe-20.04
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies.
 linux-generic-hwe-20.04 : Depends: linux-image-generic-hwe-20.04 (= 5.11.0.27.29~20.04.11) but it is not going to be installed
 linux-modules-5.11.0-27-generic : Depends: linux-image-5.11.0-27-generic but it is not going to be installed or
                                            linux-image-unsigned-5.11.0-27-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

thanks

Andrew
 
You may first have to run the 'sudo apt --fix-broken install' and let that do its thing.

Then, if you want to do what I did, follow the instructions at the linked site - they're under 'Desktop' and you do not want the method for older versions.

The instructions start with:

DESKTOP

It is advised to keep Ubuntu Desktop 20.04 LTS with the kernel flavour picked during installation. It can be either HWE or OEM flavour. Changing to track GA kernel may result in regressions of performance, hardware support, and certified features.

To check if you are on a certified hardware platform execute:

ubuntu-drivers list-oem
 
Thanks - when I run `sudo apt --fix-broken install` it doesn't actually complete (see below) and gives me a `too many errors` error. I'm wondering if maybe I should just grab my Timeshift backup...

Code:
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool libfwupdplugin1 libllvm11 linux-headers-generic-hwe-20.04 shim thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-unsigned-5.11.0-27-generic
Suggested packages:
  fdutils linux-doc | linux-hwe-5.11-source-5.11.0 linux-hwe-5.11-tools linux-modules-extra-5.11.0-27-generic
The following packages will be REMOVED
  linux-image-5.11.0-27-generic linux-image-5.8.0-59-generic
The following NEW packages will be installed
  linux-image-unsigned-5.11.0-27-generic
0 to upgrade, 1 to newly install, 2 to remove and 0 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/9,927 kB of archives.
After this operation, 9,441 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: linux-image-5.11.0-27-generic: dependency problems, but removing anyway as you requested:
 linux-modules-5.11.0-27-generic depends on linux-image-5.11.0-27-generic | linux-image-unsigned-5.11.0-27-generic; however:
  Package linux-image-5.11.0-27-generic is to be removed.
  Package linux-image-unsigned-5.11.0-27-generic is not installed.

(Reading database ... 237931 files and directories currently installed.)
Removing linux-image-5.11.0-27-generic (5.11.0-27.29~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.11.0-27-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found background image: wallpaper.png
Found linux image: /boot/vmlinuz-5.8.0-63-generic
Found initrd image: /boot/initrd.img-5.8.0-63-generic
Found linux image: /boot/vmlinuz-5.4.0-58-generic
Found initrd image: /boot/initrd.img-5.4.0-58-generic
Adding boot menu entry for UEFI Firmware Settings
/etc/grub.d/35_fwupd: line 5: /usr/share/grub: Is a directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 126
dpkg: error processing package linux-image-5.11.0-27-generic (--remove):
 installed linux-image-5.11.0-27-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.11.0-27-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
Yeah, that's well and truly messed up. You can try "dpkg --configure -a --abort-after=99999" and let it run.

Oddly, this may be one of those times when restoring from backup would be both easier and faster. If you do, then drop to the older kernel - if you want. That'll stop it from upgrading to the new kernel. Unless your hardware is new and didn't work with the older kernels, it's not a bad thing to use an older kernel.
 
Thanks - all sorted via Timeshift and life is good again. First time I've used it to restore a system - took just a few mins - impressive bit of software. Many thanks for your help - I very much appreciate it :cool:
 
Did you then go ahead and downgrade the kernel? That's what I did, though I skipped the restore step. I was able to boot to a 5.8.x kernel and do it from there. I could also have done it from the recovery mode.
 
Yes - booted into 5.8.x and restored - and it's all fine (with all traces of 5.11 now gone). Not sure whether I had a corrupt 5.11.x or whether it was something else. I think I'll stick with 5.8 for the time being. Thanks again.
 
Hey, I also ran into the same problem while trying to update software. I'm on Starlabs StarLabTop Mk IV. It seems like this is a known issue for starlabs. Just remove the `35_fwupd` and you should be good.
Code:
sudo rm /etc/grub.d/35_fwupd
 
Thanks - I don't seem to have `35_fwupd` in etc/grub.d before updating (does it appear after the update perhaps)?

This is what I do have in `grub.d` before the update:

Code:
andrew@andrew-Lite:/etc/grub.d$ ls
00_header        10_linux_zfs   30_os-prober      41_custom
05_debian_theme  20_linux_xen   30_uefi-firmware  47_starlabs
10_linux         20_memtest86+  40_custom         README
 
Hello guys! I stumbled across this post as I had a similar issue as ajstewart_lang (for a few weeks now) but it wasn't because linux-image-5.11.0-27-generic. For me the issue was linux-image-5.11.0-37-generic and it was not caused by dependencies. After trying everything that KGIII and tweddielin posted above but with no success I realised that I never tried to remove it as ajstewart_lang tried to.
So for me the below did the trick and resolved the issue.
Code:
sudo apt-get purge linux-image-5.11.0-37-generic

Disclaimer: I am a noob when it comes to Linux but I really wanted a fix for this as it always appeared in my terminal but I wasn't able to tell what the issue was or how to resolve it. This issue appeared on the latest version of Kubuntu and it showed "E: Sub-process /usr/bin/dpkg returned an error code (1)" in terminal with something about changing a value (I don't have the error message as I never thought of taking a screenshot or saving the error message).
 
I'm on lubuntu and can't figure out whats happenin, seems to be the same thing
When I try to update i get this error and can't update the mesa drivers that are disponible today

error while installing package: installed linux-image-5.11.-27-generic package post-removal script subprocess returned error exit status 1

When I thry the fix broken install code I get this

A remover linux-image-5.11.0-27-generic (5.11.0-27.29~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.11.0-27-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 10: /etc/default/grub: quiet splash ipv6.disable=1: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127

any ideas of wha is going on?
 
Which version of Lubuntu are you using? You can just copy/paste the output of:

Code:
lsb_release -a
 
@will4525 welcome to linux.org :)

With that info you will provide @KGIII could you also please provide the output of

Code:
cat /etc/grub.d

Cheers

Chris Turner
wizardfromoz
 
hey, I don't know the output cause I just solved it.
Was trying to disable ipv6 due to dns leaks I had and added some strings to the grub file.
Something like this:

I edited the grub again and deleted the strings I had added and was able to fix the broken cache messages I had before.
Lucky me the dns leaks were not related to ipv6

Thanks
 

Staff online

Members online


Top