我的树莓派有一个小问题。每次我想安装软件包时都会发生这种情况:
pi@raspberrypi:~ $ sudo apt install openjdk-8-jre
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:
chromium-browser : Depends: chromium-codecs-ffmpeg-extra (= 86.0.4240.197-rpt1) but 88.0.4324.187-rpt1 is to be installed or
chromium-codecs-ffmpeg (= 86.0.4240.197-rpt1) but it is not going to be installed
chromium-browser-l10n : Depends: chromium-browser (>= 88.0.4324.187-rpt1) but 86.0.4240.197-rpt1 is to be installed
libpython3.7-dev : Depends: libpython3.7-stdlib (= 3.7.3-2+deb10u2) but 3.7.3-2+deb10u3 is to be installed
Depends: libpython3.7 (= 3.7.3-2+deb10u2) but 3.7.3-2+deb10u3 is to be installed
openjdk-8-jre : Depends: openjdk-8-jre-headless (= 8u212-b01-1+rpi1) but it is not going to be installed
Depends: libatk-wrapper-java-jni (>= 0.33.3-9~) but it is not going to be installed
Recommends: fonts-dejavu-extra but it is not going to be installed
python3.7-dev : Depends: libpython3.7-dev (= 3.7.3-2+deb10u3) but 3.7.3-2+deb10u2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
当我运行时apt --fix-broken install
会发生这种情况:
pi@raspberrypi:~ $ 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:
chromium-browser libpython3.7-dev
Suggested packages:
webaccounts-chromium-extension unity-chromium-extension adobe-flashplugin
The following packages will be upgraded:
chromium-browser libpython3.7-dev
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/151 MB of archives.
After this operation, 5,602 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/chromium-browser_88.0.4324.187-rpt1_armhf.deb' to decompressor pipe: failed to write (Broken pipe)
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/libpython3.7-dev_3.7.3-2+deb10u3_armhf.deb' to decompressor pipe: failed to write (Broken pipe)
Reading changelogs... Done
(Reading database ... 98611 files and directories currently installed.)
Preparing to unpack .../chromium-browser_88.0.4324.187-rpt1_armhf.deb ...
Unpacking chromium-browser (88.0.4324.187-rpt1) over (86.0.4240.197-rpt1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/chromium-browser_88.0.4324.187-rpt1_armhf.deb (--unpack):
cannot copy extracted data for './usr/lib/chromium-browser/chromium-browser-v7' to '/usr/lib/chromium-browser/chromium-browser-v7.dpkg-new': unexpected end of file or stream
Preparing to unpack .../libpython3.7-dev_3.7.3-2+deb10u3_armhf.deb ...
Unpacking libpython3.7-dev:armhf (3.7.3-2+deb10u3) over (3.7.3-2+deb10u2) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libpython3.7-dev_3.7.3-2+deb10u3_armhf.deb (--unpack):
cannot copy extracted data for './usr/lib/python3.7/config-3.7m-arm-linux-gnueabihf/libpython3.7m-pic.a' to '/usr/lib/python3.7/config-3.7m-arm-linux-gnueabihf/libpython3.7m-pic.a.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/chromium-browser_88.0.4324.187-rpt1_armhf.deb
/var/cache/apt/archives/libpython3.7-dev_3.7.3-2+deb10u3_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我该如何解决?
谢谢!
答案1
您下载的某些软件包似乎已损坏。运行apt clean
以删除包缓存,然后apt --fix-broken install
再次运行,以便下载新的副本。