Debian11 安装 OpenJDK8

1. 下载安装包

wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jdk_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jre_8u322-b06-1~deb9u1_amd64.deb

2. 执行安装

dpkg -i openjdk-8-jre-headless_8u322-b06-1~deb9u1_amd64.deb
dpkg -i openjdk-8-jdk-headless_8u322-b06-1~deb9u1_amd64.deb
apt --fix-broken install libgtk2.0-common libgtk2.0-0
dpkg -i openjdk-8-jre_8u322-b06-1~deb9u1_amd64.deb
dpkg -i openjdk-8-jdk_8u322-b06-1~deb9u1_amd64.deb

中间过程可能碰到错误

1. 下面问题可以通过执行【apt --fix-broken install】修复

Unpacking openjdk-8-jre-headless:amd64 (8u322-b06-1~deb9u1) ...
dpkg: dependency problems prevent configuration of openjdk-8-jre-headless:amd64:
 openjdk-8-jre-headless:amd64 depends on ca-certificates-java; however:
  Package ca-certificates-java is not installed.
 openjdk-8-jre-headless:amd64 depends on java-common (>= 0.28); however:
  Package java-common is not installed.
 openjdk-8-jre-headless:amd64 depends on libcups2; however:
  Package libcups2 is not installed.
 openjdk-8-jre-headless:amd64 depends on liblcms2-2 (>= 2.2+git20110628); however:
  Package liblcms2-2 is not installed.
 openjdk-8-jre-headless:amd64 depends on libpcsclite1 (>= 1.3.0); however:
  Package libpcsclite1 is not installed.
 openjdk-8-jre-headless:amd64 depends on libxi6; however:
  Package libxi6 is not installed.
 openjdk-8-jre-headless:amd64 depends on libxrender1; however:
  Package libxrender1 is not installed.
 openjdk-8-jre-headless:amd64 depends on libxtst6; however:
  Package libxtst6 is not installed.

2. 下面问题可以通过执行【apt-get -f -y install】修复

dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64:
 openjdk-8-jre:amd64 depends on libgl1-mesa-glx | libgl1; however:
  Package libgl1-mesa-glx is not installed.
  Package libgl1 is not installed.
 openjdk-8-jre:amd64 depends on libatk-wrapper-java-jni (>= 0.33.3-9~); however:
  Package libatk-wrapper-java-jni is not installed.
 openjdk-8-jre:amd64 depends on libasound2 (>= 1.0.16); however:
  Package libasound2 is not installed.
 openjdk-8-jre:amd64 depends on libgif7 (>= 5.1); however:
  Package libgif7 is not installed.
 openjdk-8-jre:amd64 depends on libpulse0 (>= 0.99.1); however:
  Package libpulse0 is not installed.

你可能感兴趣的:(服务器,linux,运维)