Tuesday, April 20, 2010

Installing Sun Java 6 on Ubuntu 10.4 Lucid Lynx

It looked like Canonical was going to totally abandon Sun's JDK with the release of Lucid Lynx. After heated discussions, however, instead it was merely tucked away even deeper into the recesses of alternative repositories. Now it lives in a partner respository, so as root you'll need to run

add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update

to add the appropriate repository. Now you can use apt-get install as before to install the sun-java6-jdk or sun-java6-jre packages. For those curious, this is the "official" way to do this according to the release notes.


  1. Nice little article! You should however mention:

    add-apt-repository needs to be run as sudo

    next you need to run:
    sudo apt-get update
    and then:
    sudo apt-get install *

  2. Thanks for the comments! I updated the post to clarify those points.

  3. Thank you. Thank you. Thank you. I've been searching for the solution to this problem for 2 hours.

  4. thank you man !!!! mis respetos!!!

  5. thanks! saved my life today ;-)
    installed java manually so far but got stuck by yuuguu that persisted to depend on sun-java6-jre. Installing it by ignoring unmet dependencies broke my updatability.

  6. Thanks! That helped. Now if only they could make those repo's standard so I don't have to go looking for them with every install :@

  7. Thanx man!!!

    Very helpful hint.

    Bass D'Phar.

  8. Thanks for the clue.

    To get "add-apt-repository" on the Lucid server versions I had to start with:

    apt-get install python-software-properties

  9. Put me on the list of those saying "Thanks!!"

  10. You said : Now it lives in a partner respository, so as root you'll need to run

    Question is : How to login as root?

  11. See the "sudo" command. Basically stick "sudo" in front of the commands I posted, or run "sudo -i" then type the commands.

  12. Also note that the line is in /etc/apt/sources.list, so you can also just edit that file and remove the # before it so as to uncomment it out.

  13. wow thank you so much!

    i'm really happy now!

  14. Thanks, yet it did not work for me on Terminal, since I got:

    E: Couldn't find package Desktop

    How to fix it? Thanks.