Java 卸载问题

Java 卸载问题

我正在尝试卸载所有 Java。我收到一条错误消息,指出我已损坏软件包。当我尝试时,sudo apt-get install -f 我收到一条消息,指出遇到了错误:

 /var/cache/apt/archives/openjdk-7-jre-headless_7u75-2.5.4-1~utopic1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么建议么?

当系统建议修复时我得到的信息如下:

(Reading database ... 221624 files and directories currently installed.)
Preparing to unpack .../openjdk-7-jre-headless_7u75-2.5.4-1~utopic1_amd64.deb ...
Unpacking openjdk-7-jre-headless:amd64 (7u75-2.5.4-1~utopic1) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-7-jre-headless_7u75-2.5.4-1~utopic1_amd64.deb (--unpack):
 trying to overwrite shared '/etc/java-7-openjdk/management/jmxremote.access', which is different from other instances of package openjdk-7-jre-headless:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-7-jre-headless_7u75-2.5.4-1~utopic1_amd64.deb
Error in function: 
dpkg: dependency problems prevent configuration of ca-certificates-java:
 ca-certificates-java depends on openjdk-7-jre-headless (>= 7~u3-2.1.1~pre1-1) | java6-runtime-headless; however:
  Package openjdk-7-jre-headless:amd64 is not installed.
  Package java6-runtime-headless is not installed.
  Package oracle-java6-installer which provides java6-runtime-headless is not installed.
  Package openjdk-6-jre-headless:amd64 which provides java6-runtime-headless is not installed.
  Package openjdk-7-jre-headless:amd64 which provides java6-runtime-headless is not installed.

dpkg: error processing package ca-certificates-java (--configure):
 dependency problems - leaving unconfigured

答案1

我重新启动并通过选择进入恢复模式Ubuntu 的高级选项在 GRUB 菜单中并选择最新内核的(恢复)版本。

在恢复模式下,我选择了修复包的选项,这解决了我的问题。

答案2

尝试这个:

sudo dpkg -P /var/cache/apt/archives/openjdk-7-jre-headless_7u75-2.5.4-1~utopic1_amd64.deb

然后重试:

sudo apt-get install -f

相关内容