4

I need to install openjdk-8 on a docker container based on the latest python image (debian 10), but the openjdk-8-jdk package has been removed from the stable debian repository. I've already tried the usual apt-get install openjdk-8-jdk and apt-cache search openjdk only returns the openjdk-11.

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
Emil Chitas
  • 51
  • 1
  • 8
  • 1
    Please don't edit the answer into your question. [su] is a question and answer site and answers should be separate from questions. You can [answer your own question](https://superuser.com/help/self-answer) instead. – DavidPostill Jul 16 '19 at 16:37
  • 1
    https://stackoverflow.com/questions/57031649/how-to-install-openjdk-8-jdk-on-debian-10-buster – Martin Schröder Sep 29 '20 at 13:16

3 Answers3

3

The answer over at SO is nicer:

wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
pgpb.padilla
  • 131
  • 5
1

I've managed to solve it by manually downloading the packages with wget:

RUN wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_8u212-b03-2~deb9u1_amd64.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk_8u212-b03-2~deb9u1_amd64.deb

and then install it using the dkpg with the -i --force-all options to install all the required dependencies:

RUN dpkg -i --force-all openjdk-8-jre-headless_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jre_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jdk-headless_8u212-b03-2~deb9u1_amd64.deb openjdk-8-jdk_8u212-b03-2~deb9u1_amd64.deb    
Emil Chitas
  • 51
  • 1
  • 8
  • 1
    I can't download `Connecting to security-cdn.debian.org (security-cdn.debian.org)|151.101.36.204|:80... connected. HTTP request sent, awaiting response... 404 Not Found` – Dimitri Kopriwa Dec 22 '19 at 19:26
  • @DimitriKopriwa the packages have been updated. These are the new packages available: `http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk_8u232-b09-1~deb9u1_amd64.deb`. You can find all of them here: [debian](https://packages.debian.org/source/stretch/openjdk-8) – Emil Chitas Jan 08 '20 at 09:46
1

As "addon" to the answer of Emil Chitas using wget:

  • Check the debian site for the current version (e.g. 8u275-b01-1~deb9u1)
  • Copy the version string and set environment-variable before download
  • start download
  • install

Download with:

VER=8u275-b01-1~deb9u1 \
ARCH=amd64 \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jre_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_${VER}_${ARCH}.deb \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openjdk-8/openjdk-8-jdk_${VER}_${ARCH}.deb

Install with:

dpkg -i --force-all openjdk-8*
MrD
  • 111
  • 2