Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:
Suggested packages:
The following NEW packages will be installed:
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:
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?

share|improve this question
up vote 5 down vote accepted

Removing the corrupted package solved the problem.

sudo rm /var/cache/apt/archives/libm17n-0_1.6.3-2_armhf.deb
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.