我在系统中卸载 Java 时遇到问题。我试过这个如何彻底卸载Java?但我总是遇到同样的错误。
The following packages have unmet dependencies:
default-jre : Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed
default-jre-headless : Depends: openjdk-7-jre-headless (>= 7~u3-2.1.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
当我输入时,apt-get -f install
出现此错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libgsl0ldbl libguvcview-1.1-1 libsdl2-2.0-0 libwebcam0
linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic
linux-image-4.2.0-16-generic linux-image-extra-4.2.0-16-generic uvcdynctrl
uvcdynctrl-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
openjdk-7-jre-headless
Suggested packages:
icedtea-7-jre-jamvm sun-java6-fonts fonts-ipafont-gothic
fonts-ipafont-mincho ttf-wqy-microhei ttf-wqy-zenhei fonts-indic
The following NEW packages will be installed:
openjdk-7-jre-headless
0 upgraded, 1 newly installed, 0 to remove and 23 not upgraded.
74 not fully installed or removed.
Need to get 0 B/39,3 MB of archives.
After this operation, 55,7 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 287924 files and directories currently installed.)
Preparing to unpack .../openjdk-7-jre-headless_7u95-2.6.4-0ubuntu0.15.10.1_amd64.deb ...
Unpacking openjdk-7-jre-headless:amd64 (7u95-2.6.4-0ubuntu0.15.10.1) ...
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/openjdk-7-jre-headless_7u95-2.6.4-0ubuntu0.15.10.1_amd64.deb' to decompressor pipe: failed to read (Input/output error)
dpkg-deb (subprocess): decompressing archive member: lzma error: unexpected end of input
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/openjdk-7-jre-headless_7u95-2.6.4-0ubuntu0.15.10.1_amd64.deb (--unpack):
cannot copy extracted data for './usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar' to '/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/openjdk-7-jre-headless_7u95-2.6.4-0ubuntu0.15.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
任何人都知道我做错了什么,因为我无法安装任何东西。
答案1
它说解压档案时出错。在这种情况下,可能是因为下载不正确。删除提到的档案文件并重试:
sudo rm /var/cache/apt/archives/openjdk-7-jre-headless_7u95-2.6.4-0ubuntu0.15.10.1_amd64.deb
sudo apt-get -f install