在Debian Jessie中安装Openjdk-8的麻烦

时间:2018-01-19 23:38:37

标签: docker debian debian-jessie

我正在尝试在debian jessie docker containier中安装jdk-8。下面是泊坞文件

FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive

RUN \
  echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list &&\
apt-get update && apt-get install openjdk-8-jdk &&\
update-alternatives --config java

我收到以下错误

 The following packages have unmet dependencies:openjdk-8-jdk : Depends: openjdk-8-jre (= 8u131-b11-1~bpo8+1) but it is not going to be installed.Depends: openjdk-8-jdk-headless (= 8u131-b11-1~bpo8+1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.The command '/bin/sh -c echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list &&  apt-get update && apt-get install openjdk-8-jdk &&  update-alternatives --config java' returned a non-zero code: 100

请让我知道如何解决这个问题。

2 个答案:

答案 0 :(得分:3)

您应该在下面使用它来安装jdk

apt-get install -t jessie-backports openjdk-8-jdk

答案 1 :(得分:0)

以下更改对我有用

apt-get -y  update && apt-get install -y -t jessie-backports ca-certificates-java && apt-get -y install openjdk-8-jdk && update-alternatives --config java