After I upgraded 20.04 to 22.04 I cannot install new software because the old linux-image-5.13.0-23-generic (5.13.0-23.23) cannot be removed. During the upgrade I told the system to keep old stuff, which was probably the cause of this problem. When I try to install new software, I get the following output:
Removing linux-image-5.13.0-23-generic (5.13.0-23.23) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.13.0-23-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 ...
/etc/grub.d/bin/grubcfg_proxy: error while loading shared libraries: libcrypto.so.1.1: 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-5.13.0-23-generic (--remove):
subprocess package linux-image-5.13.0-23-generic install script post-removal d returned error value 1
dpkg: too many errors; stopped
Errors found while processing: linux-image-5.13.0-23-generic
Processing was aborted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried sudo apt-get --purge remove linux-image-5.13.0-23-generic and sudo apt-get install -f but I get the same output as above.
Thanks. Unfortunately I had to reinstall Ubuntu 22.04 because I caught a trojan horse and could not install ClamAV because of this kernel problem. I did not dare to use ubuntu to try your suggestion. I will leave this queston for a few days before removing it.