2

I keep having an error installing / updating / basically doing anything that concerns packages. I am trying to get an I2C library going and I can't get sudo-apt-get install i2c-tools to work from a failing dpkg.

The error code I am getting is:

dpkg: unrecoverable fatal error, aborting:
files list for package 'libcap2:armf' is missing final newline
e: sub-process /user/bin/dpkg return an error code (2)

Whenever I try sudo apt-get remove libcap2:armf (or libcap2-bin) it begins, but when I select Y to complete it throws up a dpkg error for libcap2:armf... I can't remove it all the way because whatever it's doing is dependent on this?

Is there any way to recover from this? Otherwise I have to move my pi to a fresh OS and reconfigure it all (as I unfortunately did not take an established backup).

1 Answers1

1

Based on this Ask Ubuntu answer, you could:

mkdir ~/dpkg-info
sudo mv /var/lib/dpkg/info/libcap2:armf.* ~/dpkg-info

This keeps a copy of the corrupted file(s) in ~/dpkg-info for whatever reason; if you don't want to bother with that use rm /var/lib/dpkg/info/libcap2:armf.* instead.

Then:

sudo dpkg --configure -a
sudo apt update
sudo apt upgrade

Hopefully whatever caused the problem did not have more widespread consequences.

goldilocks
  • 60,325
  • 17
  • 117
  • 234