Debian

Debian Stretch 64 位上的 OpenJDK7 JRE 32 位

  • August 11, 2016

我目前正在使用 Debian Stretch(目前正在測試)。我需要安裝Java 7 32 位才能使用僅與該特定版本兼容的舊小程序:沒有 64 位,沒有 Java 8(請不要評判我)。

目前openjdk-7-jre在測試中沒有可用的包,只有openjdk-7-jre,它甚至不適用於 i386 架構,也不足以執行小程序。

我想到了從穩定版本(Jessie)中固定它的想法,所以我添加了以下文件:

/etc/apt/sources.list.d/stable.list

deb http://ftp.caliu.cat/debian/ stable main contrib non-free
deb-src http://ftp.caliu.cat/debian/ stable main contrib non-free

deb http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free

# stable-updates, previously known as 'volatile'
deb http://ftp.caliu.cat/debian/ stable-updates main contrib non-free
deb-src http://ftp.caliu.cat/debian/ stable-updates main contrib non-free

/etc/apt/preferences.conf

Package: *
Pin: release a=stable
Pin-Priority: 100

現在,我可以找到 package openjdk-7-jre:i386,但是,當我嘗試通過安裝它時,apt-get -t stable install openjdk-7-jre:i386我得到了這個:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
openjdk-7-jre:i386 : Depends: openjdk-7-jre-headless:i386 (= 7u111-2.6.7-1~deb8u1) but it is not going to be installed
                     Depends: libatk1.0-0:i386 (>= 1.12.4) but it is not going to be installed
                     Depends: libcairo2:i386 (>= 1.2.4) but it is not going to be installed
                     Depends: libfontconfig1:i386 (>= 2.11) but it is not going to be installed
                     Depends: libfreetype6:i386 (>= 2.2.1) but it is not going to be installed
                     Depends: libgdk-pixbuf2.0-0:i386 (>= 2.22.0) but it is not going to be installed
                     Depends: libgtk2.0-0:i386 (>= 2.8.0) but it is not going to be installed
                     Depends: libpango-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                     Depends: libpangocairo-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                     Depends: libpangoft2-1.0-0:i386 (>= 1.14.0) but it is not going to be installed
                     Depends: libx11-6:i386 but it is not going to be installed
                     Depends: libxcomposite1:i386 (>= 1:0.3-1) but it is not going to be installed
                     Depends: libxext6:i386 but it is not going to be installed
                     Depends: libxi6:i386 but it is not going to be installed
                     Depends: libxrender1:i386 but it is not going to be installed
                     Depends: libxtst6:i386 but it is not going to be installed
                     Depends: libxrandr2:i386 but it is not going to be installed
                     Depends: libxinerama1:i386 but it is not going to be installed
                     Depends: libgl1-mesa-glx:i386 but it is not going to be installed or
                              libgl1:i386
                     Depends: libatk-wrapper-java-jni:i386 (>= 0.30.4-0ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我對 Apt-pinning 不是很有經驗,所以我以同樣的運氣嘗試了其他Pin-Priority值。

當然我可以自己下載openJDK-7 JRE 32位版本並安裝它,但我真的更喜歡使用包管理器,如果可能的話,誰能給我一個提示我做錯了什麼?

謝謝!

libgif4在 stable 和 testing ( and )之間有一些變化,tzdata-java這將使得使用openjdk-7-jre.

相反,由於您正在執行測試,您應該使用目前在實驗中可用的版本;添加

deb http://ftp.caliu.cat/debian/ experimental main
deb-src http://ftp.caliu.cat/debian/ experimental main

到您的儲存庫,apt-get update然後您應該能夠安裝openjdk-7-jre:i386.

安裝包 multi-arch 主要是要求很多痛苦。

從非固定 repo 安裝特定包不會自動安裝其所有依賴項。您可以嘗試在 apt-get 命令中列出所有依賴項。

儘管我建議您一直使用軟體包,但我認為您可能需要在這種情況下重新考慮。

就個人而言,我什至可能會嘗試在 Docker 容器中執行應用程序,以免污染主機​​的其餘部分,但那是另一回事了。

引用自:https://unix.stackexchange.com/questions/302851