0

I'm a Linux noob, and I trying to follow a variety of articles on installing Java 8 on Debian 8 (Jessie):

However, I get a bunch of dependency errors preventing me from installing 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

Other configuration information:

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

I don't know how to diagnose the problem and resolve it. Can somebody point me in the right direction?

Elenesski
  • 409
  • 1
  • 5
  • 17

2 Answers2

0

Answering my own question; in hopes it might help somebody else; because I spent 2+ days being frustrated.

It turns out that the reason it was failing is there is another package that I was trying to install that was dependent on Java8. The fact that this package was trying to install, is what prevented Java8 from being installed. Only after I did a:

apt-get --purge remove packagename

Java could then install. Once java was installed, I could then reinstall the offending package.

Elenesski
  • 409
  • 1
  • 5
  • 17
-1

Another solution is sudo apt-get purge openjdk-\* -y I wrote a shell script that does everything including removing other versions of Java. See: https://github.com/Nat-As/installjava8

c10ud
  • 196
  • 3
  • 12
  • Hello! A link to your github is welcome, but please add the relevant part of the solution in the answer. Stack Overflow answers must be self sufficient and not rely on an external resource. External resources should be an extra, people reading your answer have to find it useful without clicking on the link. – Valentino Aug 03 '19 at 21:19
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/23704187) – Nico Haase Aug 03 '19 at 21:21
  • @NicoHaase I've edited my answer. Running the snippet in a terminal will fix the problem for any version of java that needs to be purged. This answer will work for most people with this problem regardless of the java version they have installed. – c10ud Aug 16 '19 at 02:49