Unix

為什麼我不能在 Ubuntu 中通過“sudo aptitude”安裝 Java?

  • October 13, 2009
$ 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

這是我的 /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.

注意多元宇宙在那裡!為什麼不安裝Java!?

在最後兩行更改dapperjaunty,或者,確保multiverse為其中jaunty一行啟用。

或者,您可以使用其他一些 jvm,例如:

sudo aptitude install openjdk-6-jre

引用自:https://serverfault.com/questions/73865