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 http://archive.canonical.com/ 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.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sun-java6 Edit question
Assignee:
No assignee Edit question
Solved by:
madmed
Solved:
2010-07-07
Last query:
2010-07-07
Last reply:
2010-07-06
Best madmed (medbelh) said : #1

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 http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
then sudo apt-get update

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.

http://www.ubuntugeek.com/how-install-sun-java-runtime-environment-jre-in-ubuntu-10-04-lucid-lynx.html

cat96 (tristanlund) said : #3

Thanks madmed, that solved my question.