2

I've got a server that's running Debian Squeeze and upgrading to Wheezy isn't an option. I need to install version 7 of the JRE as there's some bug fixes in there I require. My options are:

  • Install openjdk-7-jre from the wheezy package repository
  • Install oracle 7 jre

We would preferably like to install openjdk but I'm finding it very difficult. I tried installing using apt-get openjdk-7-jre and got the following response:

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: openjdk-7-jre-headless (= 7u3-2.1.3-1) but it is not going to be installed
             Depends: libfontconfig1 (>= 2.9.0) but 2.8.0-2.1 is to be installed
             Depends: libgdk-pixbuf2.0-0 (>= 2.22.0) but it is not going to be installed
             Depends: libjpeg8 (>= 8c) but 8b-1 is to be installed
             Depends: libpulse0 (>= 0.99.1) but 0.9.21-3+squeeze1 is to be installed
             Depends: libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2) but it is not going to be installed
E: Broken packages

I then tried aptitude and got this response:

0 packages upgraded, 76 newly installed, 0 to remove and 0 not upgraded.
Need to get 56.9 MB of archives. After unpacking 171 MB will be used.
The following packages have unmet dependencies:
  libnss3: Conflicts: libnss3-1d (< 2:3.13.4-2) but 3.12.8-1+squeeze6 is installed.
  openjdk-7-jre: Depends: libfontconfig1 (>= 2.9.0) but 2.8.0-2.1 is installed.
             Depends: libjpeg8 (>= 8c) but it is not going to be installed.
             Depends: libpulse0 (>= 0.99.1) but it is not going to be installed.
  libgdk-pixbuf2.0-0: Depends: libglib2.0-0 (>= 2.31.18) but 2.24.2-1 is installed.
                  Depends: libjpeg8 (>= 8c) but it is not going to be installed.
                  Depends: libtiff4 (>= 3.9.5-2) but 3.9.4-5+squeeze8 is installed.
                  Breaks: libgtk2.0-0 (< 2.21.3) but 2.20.1-2 is installed.
                  Breaks: libgtk2.0-bin (< 2.21.3) but 2.20.1-2 is installed.
  icedtea-7-jre-cacao: Depends: libstdc++6 (>= 4.6) but 4.4.5-8 is installed.
  libatk-wrapper-java-jni: Depends: libglib2.0-0 (>= 2.31.8) but 2.24.2-1 is installed.
  openjdk-7-jre-headless: Depends: libjpeg8 (>= 8c) but it is not going to be installed.
                      Depends: libfontconfig1 (>= 2.9.0) but 2.8.0-2.1 is installed.
                      Depends: libglib2.0-0 (>= 2.26.0) but 2.24.2-1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:   
1)     icedtea-7-jre-cacao [Not Installed]                   
2)     icedtea-7-jre-jamvm [Not Installed]                   
3)     libatk-wrapper-java-jni [Not Installed]               
4)     libgdk-pixbuf2.0-0 [Not Installed]                    
5)     libnss3 [Not Installed]                               
6)     openjdk-7-jre [Not Installed]                         
7)     openjdk-7-jre-headless [Not Installed]                
8)     openjdk-7-jre-lib [Not Installed]                     

     Leave the following dependencies unresolved:            
9)     libatk-wrapper-java recommends libatk-wrapper-java-jni

Accept this solution? [Y/n/q/?] 

Accepting the solution ends like this:

No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Sorry for the verbose output, I'm a novice at this.

Anyway, from what I've read it's quite difficult to install openjdk-7 on squeeze - I'm guess I'm looking for a silver bullet! Has anyone done this? Should I give up and get oracle?

Cheers,

James

2
  • What is in your /etc/apt/sources.list? Jan 10, 2013 at 17:01
  • In my apt/sources.list I've added wheezy's main repo so that I can see the openjdk-7-jre pacakge when I search for an openjdk packacge. That works fine. However, when I come to install it, it tells me there's lots of conflicts etc and I'm not too sure how to proceed. I've read elsewhere that installing openjdk7 on squeeze is such a pain that most people just go with oracle... but I don't really want to do that if I can avoid it. Jan 11, 2013 at 7:34

1 Answer 1

4

I don't know the particular reason why your attempt failed (it might be related to APT conf, etc.), but I managed to install openjdk7 on squeeze quite easily without any noticeable side effects so far.

A word of warning is due here: mixing packages from different releases (e.g. stable and testing) is risky. A package installed from another release may not be compatible with the others and might even break other packages. It's especially risky to upgrade critical packages like libc, which will be upgraded in this case.

Firstly, you need to setup package priorities so that APT does not start pulling in everything from testing. For more information you can refer to apt_preferences(5) manual page and The Debian Administrator's Handbook.

  1. Include wheezy in the sources.list (I assume you have already done that)

  2. Setup priorities

    Set squeeze as the default release

    $ cat /etc/apt/apt.conf.d/local  
    APT::Default-Release "squeeze";
    

    This effectively sets priority 990 for squeeze packages.

    By doing a simulated upgrade I noticed APT is trying to upgrade some packages from testing. apt-cache policy explained this is happening for packages which are installed from backports (installed package priority 100 vs 500 for packages available in testing). Not sure if that's the best thing to do, but to resolve this (avoid upgrading packages from backports with versions from testing) I minimized testing priority (you don't have to do this if you don't use backports)

    $ cat /etc/apt/preferences.d/wheezy 
    Package: *
    Pin: release n=wheezy
    Pin-Priority: 10
    

    "10" is just an arbitrary number I chose, which is less than 100. I guess with this pin security updates won't be fetched for packages installed from testing (haven't tested yet), would be interesting to resolve this as well.

  3. Install the openjdk7 selecting wheezy as the target release

    # apt-get install -t wheezy openjdk-7-jdk
    

As essential libraries will be upgraded in the process be ready to restart some services (will be restarted automatically with your agreement). And I wouldn't recommend doing it in a graphical session - I was instructed to stop my display manager before upgrading libc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.