如何解决与在Debian 8(Jessie)上安装Java 8相关的问题?

时间:2018-05-01 19:33:52

标签: java java-8 debian apt-get debian-jessie

我是一个Linux菜鸟,我试图关注在Debian 8(Jessie)上安装Java 8的各种文章:

但是,我遇到了一堆依赖错误,导致我无法安装openjdk-8-jre。

apt-get -f install openjdk-8-jre

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:
 openjdk-8-jre : Depends: openjdk-8-jre-headless (= 8u162-b12-1~bpo8+1)
                 Depends: libglib2.0-0 (>= 2.24) but it is not going to be installed
                 Depends: libxrandr2 but it is not going to be installed
                 Depends: libxinerama1 but it is not going to be installed
                 Depends: libgl1-mesa-glx but it is not going to be installed or
                          libgl1
                 Depends: libgtk-3-0 but it is not going to be installed
                 Depends: libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2) but it is not going to be installed
                 Depends: libasound2 (>= 1.0.16)
                 Depends: libgif4 (>= 4.1.4) but it is not going to be installed
                 Depends: libpulse0 (>= 0.99.1) but it is not going to be installed
                 Depends: libxext6 but it is not going to be installed
                 Recommends: fonts-dejavu-extra but it is not going to be installed

其他配置信息:

cat /proc/version:
    head
    Linux version 3.16.0-5-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08)

cat /etc/*-release

    ID=azure
    AZURE_IMAGE_VERSION="8.0.201804150"
    BUILD_INFO_URL="https://azure-build.debian.net/job/image-jessie/933/"
    PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
    NAME="Debian GNU/Linux"
    VERSION_ID="8"
    VERSION="8 (jessie)"
    ID=debian
    HOME_URL="http://www.debian.org/"
    SUPPORT_URL="http://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

/etc/apt# head -999 sources.list

    deb http://debian-archive.trafficmanager.net/debian jessie main
    deb-src http://debian-archive.trafficmanager.net/debian jessie main
    deb http://debian-archive.trafficmanager.net/debian-security jessie/updates main
    deb-src http://debian-archive.trafficmanager.net/debian-security jessie/updates main
    deb http://debian-archive.trafficmanager.net/debian jessie-updates main
    deb-src http://debian-archive.trafficmanager.net/debian jessie-updates main
    deb http://debian-archive.trafficmanager.net/debian jessie-backports main
    deb-src http://debian-archive.trafficmanager.net/debian jessie-backports main
    deb http://ftp.debian.org/debian jessie-backports main

/etc/apt/sources.list.d# head -999 *

    ==> jessie-backports.list <==
        deb http://http.debian.net/debian jessie-backports main

    ==> matrix.list <==
        deb https://matrix.org/packages/debian/ jessie main
        deb-src https://matrix.org/packages/debian/ jessie main

    ==> webupd8team-java.list <==
        deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
        deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main

我不知道如何诊断问题并解决问题。有人能指出我正确的方向吗?

2 个答案:

答案 0 :(得分:0)

回答我自己的问题;希望它可以帮助别人;因为我花了2天多时间感到沮丧。

事实证明它失败的原因是我尝试安装的另一个包依赖于Java8。这个软件包试图安装的事实是阻止Java8安装的原因。只有在我做了之后:

apt-get --purge remove packagename

然后可以安装Java。一旦安装了java,我就可以重新安装有问题的软件包。

答案 1 :(得分:-1)

另一个解决方案是sudo apt-get purge openjdk-\* -y,我编写了一个shell脚本,该脚本可以完成所有工作,包括删除其他Java版本。参见:https://github.com/Nat-As/installjava8