Problem installing Ubuntu 11

Java 6 would not install from
apt-get install sun-java6-jre
“package sun-java6-jre is not available”

I found some help on a ubuntu form Happy-coding:

sudo add-apt-repository “deb archive.canonical.com/ lucid partner”

that fixed it.

Just to expand on this the sun-java6-jre package is not available from the main repository because of how the licensing is laid out by Oracle. To get the Sun Java environment you need to add the partner repository.

You can do this by using add-apt-repository to add the partner repository
[ul]
[li] sudo add-apt-repository "deb [archive.canonical.com/](http://archive.canonical.com/) lucid partner" for 10.4 LTS[/li]
[li] sudo add-apt-repository "deb [archive.canonical.com/](http://archive.canonical.com/) maverick partner" for 10.10[/li]
[li] sudo add-apt-repository "deb [archive.canonical.com/](http://archive.canonical.com/) natty partner" for 11.04[/li][/ul]
or
[ul]
[li] uncommenting the partner repository in the file /etc/apt/sources.list[/li][/ul]