10

I am having issues with apt-get on my Raspberry Pi. This is the output when I try and install a package:

pi@raspberrypi ~ $ sudo apt-get -f install cowsay Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: emacs23 : Depends: libm17n-0 (>= 1.6.1) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

sudo apt-get -f install didn't help:

sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: libm17n-0 Suggested packages: m17n-docs The following NEW packages will be installed: libm17n-0 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. 12 not fully installed or removed. Need to get 0 B/258 kB of archives. After this operation, 837 kB of additional disk space will be used. Do you want to continue [Y/n]? y Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <$__ANONIO__> line 515. (Reading database ... 58096 files and directories currently installed.) Unpacking libm17n-0 (from .../libm17n-0_1.6.3-2_armhf.deb) ... dpkg: error processing /var/cache/apt/archives/libm17n-0_1.6.3-2_armhf.deb (--unpack): corrupted filesystem tarfile - corrupted package archive dpkg-deb (subprocess): decompressing archive member: internal gzip read error: '<fd:4>: invalid distance too far back' dpkg-deb: error: subprocess <decompress> returned error exit status 2 Errors were encountered while processing: /var/cache/apt/archives/libm17n-0_1.6.3-2_armhf.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

Any suggestion on how this issue can be resolved, beside reflashing the SD and starting again?

2 Answers 2

7

Removing the corrupted package solved the problem.

sudo rm /var/cache/apt/archives/libm17n-0_1.6.3-2_armhf.deb 
0
0

Anyone having this problem should use 'aptitude', even removing the .deb files won't work sometimes.

aptitude update aptitude dist-upgrade 

In this step you will be asked you if you want to remove packages with unmet dependencies or not? you should say yes and let the aptitude do the job, finally you will see that 'apt-get' will no more get stuck on unmet dependencies.

In this answer, I assumed that you want to abort installation and remove corrupted package files.

2
  • 1
    I got the same error with aptitude. Only removing the corrupt archives worked. Commented Oct 2, 2018 at 2:52
  • wait what? no remember the time I was dealing with this problem, removing files didn't solve my problem. I don't remember how did I mess with my system, but I definitely remember nothing was working after hours of struggling. @partofthething Commented Oct 2, 2018 at 2:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.