0

How to solve this?

sudo apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-5.15.0-1063-raspi
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 11.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 129650 files and directories currently installed.)
Removing linux-image-5.15.0-1063-raspi (5.15.0-1063.66) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-1063-raspi
/etc/kernel/postrm.d/zz-flash-kernel:
find: ‘/lib/firmware/5.15.0-1063-raspi’: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-flash-kernel exited with return code 1
dpkg: error processing package linux-image-5.15.0-1063-raspi (--remove):
 installed linux-image-5.15.0-1063-raspi package post-removal script subprocess returned error exit 
status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-1063-raspi
Processing was halted because there were too many errors.
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried this:

sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  linux-modules-5.15.0-1063-raspi
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 46.7 MB of archives.
After this operation, 199 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 linux-modules-5.15.0-1063-raspi arm64 5.15.0-1063.66 [36.3 MB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 linux-image-5.15.0-1063-raspi arm64 5.15.0-1063.66 [10.5 MB]
Fetched 46.7 MB in 10s (4714 kB/s)                                                                 
Selecting previously unselected package linux-modules-5.15.0-1063-raspi.
(Reading database ... 129650 files and directories currently installed.)
Preparing to unpack .../linux-modules-5.15.0-1063-raspi_5.15.0-1063.66_arm64.deb ...
Unpacking linux-modules-5.15.0-1063-raspi (5.15.0-1063.66) ...
dpkg: dependency problems prevent configuration of linux-modules-5.15.0-1063-raspi:
 linux-modules-5.15.0-1063-raspi depends on linux-image-5.15.0-1063-raspi; however:
  Package linux-image-5.15.0-1063-raspi is not installed.

dpkg: error processing package linux-modules-5.15.0-1063-raspi (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: linux-modules-5.15.0-1063-raspi needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried

sudo dpkg --configure -a

whit no result.

Also tried

sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-5.15.0-1063-raspi
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 11.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 129650 files and directories currently installed.)
Removing linux-image-5.15.0-1063-raspi (5.15.0-1063.66) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-1063-raspi
/etc/kernel/postrm.d/zz-flash-kernel:
find: ‘/lib/firmware/5.15.0-1063-raspi’: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-flash-kernel exited with return code 1
dpkg: error processing package linux-image-5.15.0-1063-raspi (--remove):
 installed linux-image-5.15.0-1063-raspi package post-removal script subprocess returned error exit 
status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-1063-raspi
Processing was halted because there were too many errors.
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

and

sudo apt clean

also tried

sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-modules-5.15.0-1063-raspi:
 linux-modules-5.15.0-1063-raspi depends on linux-image-5.15.0-1063-raspi; however:
  Package linux-image-5.15.0-1063-raspi is not installed.

dpkg: error processing package linux-modules-5.15.0-1063-raspi (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: linux-modules-5.15.0-1063-raspi

aptitude will not install due to problems

sudo apt install aptitude
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  aptitude-common bzip2 libboost-iostreams1.74.0 libcwidget4 libdpkg-perl libfile-fcntllock-perl
  libsigc++-2.0-0v5 libxapian30
Suggested packages:
  apt-xapian-index aptitude-doc-en | aptitude-doc debtags tasksel bzip2-doc libcwidget-dev
  debian-keyring gcc | c-compiler bzr xapian-tools
The following packages will be REMOVED:
  linux-image-5.15.0-1063-raspi
The following NEW packages will be installed:
  aptitude aptitude-common bzip2 libboost-iostreams1.74.0 libcwidget4 libdpkg-perl
  libfile-fcntllock-perl libsigc++-2.0-0v5 libxapian30
0 upgraded, 9 newly installed, 1 to remove and 2 not upgraded.
1 not fully installed or removed.
Need to get 4148 kB of archives.
After this operation, 10.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 aptitude-common all 0.8.13-3ubuntu1 [1719 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libboost-iostreams1.74.0 arm64 1.74.0-14ubuntu3 [243 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libsigc++-2.0-0v5 arm64 2.10.4-2ubuntu3 [11.7 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 libcwidget4 arm64 0.5.18-5build1 [272 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 libxapian30 arm64 1.4.18-4 [656 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 aptitude arm64 0.8.13-3ubuntu1 [942 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 bzip2 arm64 1.0.8-5build1 [34.6 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 libdpkg-perl all 1.21.1ubuntu2.3 [237 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libfile-fcntllock-perl arm64 0.22-3build7 [33.7 kB]
Fetched 4148 kB in 1s (3057 kB/s)                  
(Reading database ... 129651 files and directories currently installed.)
Removing linux-image-5.15.0-1063-raspi (5.15.0-1063.66) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.15.0-1063-raspi
/etc/kernel/postrm.d/zz-flash-kernel:
find: ‘/lib/firmware/5.15.0-1063-raspi’: No such file or directory
run-parts: /etc/kernel/postrm.d/zz-flash-kernel exited with return code 1
dpkg: error processing package linux-image-5.15.0-1063-raspi (--remove):
 installed linux-image-5.15.0-1063-raspi package post-removal script subprocess returned error exit 
status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.15.0-1063-raspi
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

1 Answers1

0

This fixed my broken system:

sudo apt --fix-broken install

I also tried the following in this order if it helps someone:

sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
sudo dpkg --remove --force-remove-reinstreq linux-image-5.15.0-1063-raspi
sudo apt install aptitude
sudo apt-get autoremove -f
sudo dpkg -P --force-depends linux-image-5.15.0-1063-raspi
sudo apt install  linux-image-5.15.0-1063-raspi
sudo dpkg -P --force-depends linux-image-5.15.0-1063-raspi
sudo apt autoremove
sudo apt --fix-broken install