can't install java 6 on ubuntu 10.04

Asked by cat96 on 2010-07-06

when I try to install java the first command is

sudo add-apt-repository “deb lucid partner”

all the terminal says is "need a repository as argument"

then all of the commands are fine until i get to the last command

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

then the terminal says

Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jre has no installation candidate

Am i missing something important? i did all of the commands in between.


Question information

English Edit question
Ubuntu sun-java6 Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Best madmed (medbelh) said :

1st method: gksu --desktop /usr/share/applications/software-properties-gtk.desktop /usr/bin/software-properties-gtk
and check the partner repository in the second tab.

2nd method: sudo gedit /etc/apt/sources.list and add these lines
deb lucid partner
deb-src lucid partner
then sudo apt-get update

Revision history for this message
actionparsnip (andrew-woodhead666) said :

Don't run gedit with sudo. It doesn't set up the x environment properly. Use gksu for graphical apps and sudo for command line apps ONLY.

You can add the repo in /etc/apt/sources.list as above then run:

sudo apt-get update

You will get a key error you will then need to resolve but we can cross that bridge when we get there. You will then be able to install java as expected.

Revision history for this message
cat96 (tristanlund) said :

Thanks madmed, that solved my question.