The Sun Java packages are not available in the default Ubuntu repositories. You need to enable Canonical's partner repositories. After following the below procedure they should be available:
- Open System -> Administration -> Software Sources
- Switch to the "Other Software" tab.
- Enable the repository with this listing:
http://archive.canonical.com/ubuntu lucid partner
- Update your Apt cache; either in Synaptic (press the Reload button), or on the commandline (
sudo aptitude update
). - Now the packages should be available in Synaptic or via your installation command. You can also use this aptitude variation:
sudo aptitude install sun-java6-jre sun-java6-plugin