apt-get
我的问题树莓派。这是我尝试安装软件包时的输出:
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
没有帮助:
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)
除了重新刷新 SD 并重新开始之外,还有什么建议可以解决此问题?
答案1
删除损坏的包解决了问题。
sudo rm /var/cache/apt/archives/libm17n-0_1.6.3-2_armhf.deb
答案2
遇到此问题的任何人都应该使用“aptitude”,即使删除 .deb 文件有时也不起作用。
aptitude update
aptitude dist-upgrade
在此步骤中,系统将询问您是否要删除具有未满足依赖项的包?你应该说“是”并让 aptitude 完成这项工作,最后你会看到“apt-get”将不再陷入未满足的依赖关系。
在这个答案中,我假设您想要中止安装并删除损坏的包文件。