Java – Why can’t I install Java via “sudo aptitude” in Ubuntu

aptitudeinstallationjavaunix

$ sudo aptitude install sun-java6-jdk
[sudo] password for fal:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
No candidate version found for sun-java6-jdk
No candidate version found for sun-java6-jdk
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

This is my /etc/apt/source.list:

deb http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe
deb http://security.ubuntu.com/ubuntu jaunty-security main restricted universe
deb-src http://security.ubuntu.com/ubuntu jaunty-security main restricted universe
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse.

Notice multiverse is in there! Why won't Java install!?

Best Answer

Change dapper to jaunty in the last two lines, or, ensure that multiverse is enabled for one of the jaunty lines.