Emil Chitas Asked: 2019-07-17 05:23:26 +0800 CST2019-07-17 05:23:26 +0800 CST 2019-07-17 05:23:26 +0800 CST 用于 Debian 10 的 openjdk-8 772 我需要在基于最新 python 映像(debian 10)的 docker 容器上安装 openjdk-8,但 openjdk-8-jdk 包已从稳定的 debian 存储库中删除。我已经尝试过通常的 方法apt-get install openjdk-8-jdk ,apt-cache search openjdk只返回 openjdk-11。 debian openjdk 3 个回答 Voted pgpb.padilla 2020-12-16T02:34:50+08:002020-12-16T02:34:50+08:00 SO的答案更好: 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 Best Answer Emil Chitas 2019-07-20T01:15:44+08:002019-07-20T01:15:44+08:00 我设法通过使用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 然后使用带有-i --force-all选项的dkpg安装它以安装所有必需的依赖项: 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 MrD 2021-02-26T00:13:40+08:002021-02-26T00:13:40+08:00 作为 Emil Chitas 使用wget的答案的“插件” : 检查当前版本的debian站点(例如8u275-b01-1~deb9u1) 下载前复制版本字符串并设置环境变量 开始下载 安装 下载: 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 安装: dpkg -i --force-all openjdk-8*
SO的答案更好:
我设法通过使用wget手动下载软件包来解决它:
然后使用带有-i --force-all选项的dkpg安装它以安装所有必需的依赖项:
作为 Emil Chitas 使用wget的答案的“插件” :
8u275-b01-1~deb9u1
)下载:
安装: