I get the error Errors were encountered while processing: linux-image-5.13.0-30-generic
when processing anything but i cannot remove, reinstall or fix the package
The error will often look like this:
root@name-MS-Number:~# sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-generic-hwe-20.04 thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
linux-image-unsigned-5.13.0-30-generic linux-modules-5.13.0-27-generic
Suggested packages:
fdutils linux-doc | linux-source-5.13.0 linux-tools
linux-modules-extra-5.13.0-30-generic
The following packages will be REMOVED:
linux-image-5.13.0-30-generic
The following NEW packages will be installed:
linux-image-unsigned-5.13.0-30-generic linux-modules-5.13.0-27-generic
0 upgraded, 2 newly installed, 1 to remove and 18 not upgraded.
3 not fully installed or removed.
Need to get 0 B/40,3 MB of archives.
After this operation, 99,0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
dpkg: linux-image-5.13.0-30-generic: dependency problems, but removing anyway as y
ou requested:
linux-modules-5.13.0-30-generic depends on linux-image-5.13.0-30-generic | linux-
image-unsigned-5.13.0-30-generic; however:
Package linux-image-5.13.0-30-generic is to be removed.
Package linux-image-unsigned-5.13.0-30-generic is not installed.
dpkg: warning: files list file for package 'linux-firmware' missing; assuming pack
age has no files currently installed
(Reading database ... 356707 files and directories currently installed.)
Removing linux-image-5.13.0-30-generic (5.13.0-30.33) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.13.0-30-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 34: /etc/default/grub: Syntax error: EOF in backquote sub
stitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.13.0-30-generic (--remove):
installed linux-image-5.13.0-30-generic package post-removal script subprocess re
turned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.13.0-30-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
What can i do? Do i need to change anything?
Update: After one shutdown it got worse, instead of one package broken, now there's two
linux-modules-5.13.0-27-generic : Depends: linux-image-5.13.0-27-generic but it is not going to be installed or
linux-image-unsigned-5.13.0-27-generic but it is not going to be installed
linux-modules-5.13.0-30-generic : Depends: linux-image-5.13.0-30-generic but it is not going to be installed or
linux-image-unsigned-5.13.0-30-generic but it is not going to be installed
Tried to download the same type of package and replace it but didn't work