I can't seem to solve this issue despite trying everything I found googling. I can not install or remove using apt. I've tried some fixes but eventually, they fail.
> sudo apt upgrade
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-image-generic-hwe-20.04 : Depends: linux-image-5.15.0-58-generic but it is not installed
linux-modules-5.15.0-58-generic : Depends: linux-image-5.15.0-58-generic but it is not installed or
linux-image-unsigned-5.15.0-58-generic but it is not installed
linux-modules-extra-5.15.0-58-generic : Depends: linux-image-5.15.0-58-generic but it is not installed or
linux-image-unsigned-5.15.0-58-generic but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
> sudo apt-get install -f
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:
audacity-data libflac++6v5 libid3tag0 libportsmf0v5 libsoundtouch1 libsuil-0-0 libvamp-hostsdk3v5 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
linux-image-5.15.0-58-generic
Suggested packages:
fdutils linux-doc | linux-hwe-5.15-source-5.15.0 linux-hwe-5.15-tools
The following NEW packages will be installed:
linux-image-5.15.0-58-generic
0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded.
4 not fully installed or removed.
Need to get 0 B/11.3 MB of archives.
After this operation, 11.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 343840 files and directories currently installed.)
Preparing to unpack .../linux-image-5.15.0-58-generic_5.15.0-58.64~20.04.1_amd64.deb ...
Unpacking linux-image-5.15.0-58-generic (5.15.0-58.64~20.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.15.0-58-generic_5.15.0-58.64~20.04.1_amd64.deb (--unpack):
unable to open '/boot/vmlinuz-5.15.0-58-generic.dpkg-new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.15.0-58-generic_5.15.0-58.64~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
My ubuntu version:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal