1

After recent upgrades on an older machine (16.04 -> 18.04 -> 20.04), I can now no longer install anything as apt runs into an error trying to remove linux-image-4.4.0-190-generic, see below for terminal output:

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.4.0-190-generic
0 upgraded, 0 newly installed, 1 to remove and 53 not upgraded.
1 not fully installed or removed.
After this operation, 7.250 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 177055 files and directories currently installed.)
Removing linux-image-4.4.0-190-generic (4.4.0-190.220) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.4.0-190-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 linux image: /boot/vmlinuz-5.4.0-48-generic
Found initrd image: /boot/initrd.img-5.4.0-48-generic
Found linux image: /boot/vmlinuz-4.15.0-118-generic
Found initrd image: /boot/initrd.img-4.15.0-118-generic
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.0.0: cannot open 
shared object file: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.4.0-190-generic (--remove):
 installed linux-image-4.4.0-190-generic package post-removal script subprocess returned error exit s
tatus 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-4.4.0-190-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have run sudo apt update beforehand, and running sudo apt upgrade fails on the same error on removal before it manages to install anything.

The first error notice in the output of sudo apt autoremove or sudo apt install -f points to problems with shared library libcrypto.so.1.0.0 from libssl, which I cannot install to fix it because of the exact problem I'm having.

I've also tried to go around it by using --only-upgrade in combination with --reinstall libssl-dev libssl1.1, but this doesn't prevent it from trying to remove the linux-image:

sudo apt --only-upgrade install --reinstall libssl-dev libssl1.1 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.4.0-190-generic
0 upgraded, 0 newly installed, 2 reinstalled, 1 to remove and 53 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2.900 kB of archives.
After this operation, 7.250 kB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 177055 files and directories currently installed.)
Removing linux-image-4.4.0-190-generic (4.4.0-190.220) ...

[...]

How do I remove this image and/or fix the underlying problem?

Edit: added mention of sudo apt update/upgrade

Energya
  • 113

1 Answers1

1

You have suspicious binaries in the /etc/grub.d/ subdirectory, especially the grubcfg_proxy.

This file is a part of the grub-customizer package.

So you have to try to call GRUB Customizer to fix the issue by its own.

And then resume package upgrade.

N0rbert
  • 103,263