Skip to content

Instantly share code, notes, and snippets.

@r2DoesInc
Created June 20, 2017 15:20
Show Gist options
  • Save r2DoesInc/b216f0f896e7c4597edaf285cb83b606 to your computer and use it in GitHub Desktop.
Save r2DoesInc/b216f0f896e7c4597edaf285cb83b606 to your computer and use it in GitHub Desktop.
jdk 7 setup
apt-get install software-properties-common debian-archive-keyring -y
add-apt-repository 'deb http://httpredir.debian.org/debian experimental main'
add-apt-repository 'deb http://httpredir.debian.org/debian sid main'
cat >/etc/apt/preferences.d/debian <<EOL
Package: *
Pin: release o=Debian,n=experimental
Pin-Priority: -1
Package: *
Pin: release o=Debian,n=sid
Pin-Priority: -1
Package: openjdk-7-jdk
Pin: release o=Debian,n=experimental
Pin-Priority: 500
Package: openjdk-7-jre
Pin: release o=Debian,n=experimental
Pin-Priority: 500
Package: openjdk-7-jre-headless
Pin: release o=Debian,n=experimental
Pin-Priority: 500
Package: libjpeg62-turbo
Pin: release o=Debian,n=sid
Pin-Priority: 500
EOL
sudo apt update
sudo apt install openjdk-7-jdk -y
Copy link

ghost commented Sep 26, 2017

This broke on Ubuntu Xenial 16.04.3 when openjdk-7-jdk 7u151-2.6.11-1 came out. I get:

$ sudo apt install openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless libfontconfig1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libfontconfig1 is already the newest version (2.11.94-0ubuntu1.1).
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 : Depends: libfontconfig1 (>= 2.12) but 2.11.94-0ubuntu1.1 is to be installed
 openjdk-7-jre-headless : Depends: libfontconfig1 (>= 2.12) but 2.11.94-0ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Adding fontconfig to preferences results in a mess:

Package: libfontconfig1
Pin: release o=Debian,n=sid
Pin-Priority: 500

Package: fontconfig-config
Pin: release o=Debian,n=sid
Pin-Priority: 500
$ sudo apt install openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless libfontconfig1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libhunspell-dev libjs-jquery-scrollto libminizip1 python-regex python3-cssselect
  python3-cssutils python3-regex sigil-data
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  account-plugin-tools accountsservice-ubuntu-schemas apparmor-easyprof apparmor-easyprof-ubuntu
  click click-apparmor dbus-property-service fontconfig-config gir1.2-click-0.4 gir1.2-gee-0.8
  indicator-network libboost-log1.58.0 libboost-regex1.58.0 libclick-0.4-0 libconnectivity-qt1
  libcontent-hub0 libdbus-cpp5 libgflags2v5 libgoogle-glog0v5 libhybris-utils liblibertine1
  liblttng-ust-ctl2 liblttng-ust0 libonline-accounts-client1 libonline-accounts-daemon1
  libonline-accounts-qt1 libpkcs11-helper1 libprocess-cpp3 libqmenumodel0 libqofono-qt5-0
  libqt5gui5-gles libqt5opengl5-gles libqt5quick5-gles libqt5systeminfo5 libqt5xmlpatterns5
  libsystemsettings1 libtrust-store2 libubuntu-app-launch2 libubuntu-download-manager-client1
  libubuntu-download-manager-common1 libubuntuoneauth-2.0-0 libudm-common1 liburcu4
  network-manager-openvpn ofono openvpn python3-apparmor python3-apparmor-click
  python3-click-package python3-gnupg python3-libapparmor qmenumodel-qml qml-module-qtmultimedia
  qml-module-qtsysteminfo qml-module-ubuntu-connectivity qml-module-ubuntu-onlineaccounts2
  qtdeclarative5-gsettings1.0 qtdeclarative5-ofono0.2 qtdeclarative5-ubuntu-content1
  qtdeclarative5-ubuntu-settings-components system-image-common system-image-dbus
  ubuntu-keyboard-data ubuntu-system-settings ubuntu-system-settings-online-accounts
  ubuntuone-credentials-common urfkill
Suggested packages:
  click-reviewers-tools ubuntu-app-launch-tools | upstart-app-launch-tools content-hub
  libqt5libqgtk2 openjdk-7-demo openjdk-7-source visualvm icedtea-7-plugin icedtea-7-jre-jamvm
  sun-java6-fonts fonts-wqy-microhei fonts-wqy-zenhei fonts-indic easy-rsa
The following packages will be REMOVED:
  adobereader-enu:i386 gtk2-engines:i386 gtk2-engines-murrine:i386 kdeconnect-plasma
  libcairo2:i386 libcairomm-1.0-1v5:i386 libcanberra-gtk-module:i386 libcanberra-gtk0:i386
  libfontconfig1:i386 libgail18:i386 libgtk2.0-0:i386 libgtkmm-2.4-1v5:i386
  libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpangomm-1.4-1v5:i386 libpangoxft-1.0-0:i386
  libprocessui7 libqt5gui5 libqt5gui5:i386 libqt5multimedia5:i386 libqt5opengl5
  libqt5opengl5:i386 libqt5opengl5-dev libqt5quick5 libqt5svg5:i386 libqt5webkit5
  libqt5widgets5:i386 libunity-gtk2-parser0:i386 libxft2:i386 plasma-workspace qtbase5-dev
  qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools sigil signon-ui signon-ui-x11
  stellarium unity-control-center-signon unity-gtk2-module:i386 wkhtmltopdf
The following NEW packages will be installed:
  account-plugin-tools accountsservice-ubuntu-schemas apparmor-easyprof apparmor-easyprof-ubuntu
  click click-apparmor dbus-property-service gir1.2-click-0.4 gir1.2-gee-0.8 indicator-network
  libboost-log1.58.0 libboost-regex1.58.0 libclick-0.4-0 libconnectivity-qt1 libcontent-hub0
  libdbus-cpp5 libgflags2v5 libgoogle-glog0v5 libhybris-utils liblibertine1 liblttng-ust-ctl2
  liblttng-ust0 libonline-accounts-client1 libonline-accounts-daemon1 libonline-accounts-qt1
  libpkcs11-helper1 libprocess-cpp3 libqmenumodel0 libqofono-qt5-0 libqt5gui5-gles
  libqt5opengl5-gles libqt5quick5-gles libqt5systeminfo5 libqt5xmlpatterns5 libsystemsettings1
  libtrust-store2 libubuntu-app-launch2 libubuntu-download-manager-client1
  libubuntu-download-manager-common1 libubuntuoneauth-2.0-0 libudm-common1 liburcu4
  network-manager-openvpn ofono openvpn python3-apparmor python3-apparmor-click
  python3-click-package python3-gnupg python3-libapparmor qmenumodel-qml qml-module-qtmultimedia
  qml-module-qtsysteminfo qml-module-ubuntu-connectivity qml-module-ubuntu-onlineaccounts2
  qtdeclarative5-gsettings1.0 qtdeclarative5-ofono0.2 qtdeclarative5-ubuntu-content1
  qtdeclarative5-ubuntu-settings-components system-image-common system-image-dbus
  ubuntu-keyboard-data ubuntu-system-settings ubuntu-system-settings-online-accounts
  ubuntuone-credentials-common urfkill
The following packages will be upgraded:
  fontconfig-config libfontconfig1 openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless
5 upgraded, 66 newly installed, 41 to remove and 0 not upgraded.
Need to get 67.3 MB of archives.
After this operation, 315 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
$ apt-cache depends libfontconfig1
libfontconfig1
  Depends: libc6
  Depends: libexpat1
  Depends: libfreetype6
  Depends: fontconfig-config
  Breaks: xpdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment