I've never had this complex of an apt issue. I was trying to install nodejs when I came upon this unmet dependency. Updating, upgrading, and fix-broken install do not solve anything. I need to take a step back and ask for advice. Here is my specific error:
pi@raspberry:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libraspberrypi-bin libraspberrypi-dev libraspberrypi0
The following packages will be upgraded:
libraspberrypi-bin libraspberrypi-dev libraspberrypi0
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,582 kB of archives.
After this operation, 14.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 35975 files and directories currently installed.)
Preparing to unpack .../libraspberrypi-dev_1.20180919-1_armhf.deb ...
Unpacking libraspberrypi-dev (1.20180919-1) over (1.20180619-1) ...
dpkg: error processing archive /var/cache/apt/archives/libraspberrypi-dev_1.20180919-1_armhf.deb (--unpack):
unable to stat './opt/vc/include/interface/vctypes/vc_display_types.h' (which I was about to install): Structure nee
ds cleaning
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../libraspberrypi-bin_1.20180919-1_armhf.deb ...
Unpacking libraspberrypi-bin (1.20180919-1) over (1.20180619-1) ...
dpkg: error processing archive /var/cache/apt/archives/libraspberrypi-bin_1.20180919-1_armhf.deb (--unpack):
unable to stat './opt/vc/sbin/vcfiled' (which I was about to install): Structure needs cleaning
Preparing to unpack .../libraspberrypi0_1.20180919-1_armhf.deb ...
Unpacking libraspberrypi0 (1.20180919-1) over (1.20180619-1) ...
dpkg: error processing archive /var/cache/apt/archives/libraspberrypi0_1.20180919-1_armhf.deb (--unpack):
unable to stat './opt/vc/lib/libbcm_host.so' (which I was about to install): Structure needs cleaning
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libraspberrypi-dev_1.20180919-1_armhf.deb
/var/cache/apt/archives/libraspberrypi-bin_1.20180919-1_armhf.deb
/var/cache/apt/archives/libraspberrypi0_1.20180919-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Same result with any type of upgrade, whether it's apt-get upgrade or this:
pi@raspberry:~ $ sudo apt-get dist-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:
libraspberrypi0 : Depends: raspberrypi-bootloader (= 1.20180619-1) but 1.20180919-1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I have no idea what to do here. I feel like I've exhausted all my options.
Advice is MUCH appreciated. Thanks.
sudo apt-get clean
first;sudo apt-get update; sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
might help but this looks like a case where you need to restore from your backup. – Milliways Oct 10 '18 at 7:14