2010-02-16 66 views
9

我剛從小巧精緻升級到Hardy和不能爲我的生命安裝java:無法在Ubuntu上安裝的Hardy太陽的Java6-bin軟件包(8.04)

$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk 
[sudo] password for bobpete: 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
Package sun-java6-bin 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 
However the following packages replace it: 
    sun-java6-jre 
E: Package sun-java6-bin has no installation candidate

我檢查/etc/apt/sources.list並運行apt-get update好幾次,但沒有運氣:

# 
# deb cdrom:[Ubuntu-Server 6.06 _Dapper Drake_ - Release amd64 (20060531)]/ dapper main restricted 


# deb cdrom:[Ubuntu-Server 6.06 _Dapper Drake_ - Release amd64 (20060531)]/ dapper main restricted 

deb http://us.archive.ubuntu.com/ubuntu/ hardy main restricted 
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy main restricted 

## Major bug fix updates produced after the final release of the 
## distribution. 
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted 
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted 

## Uncomment the following two lines to add software from the 'universe' 
## repository. 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## universe WILL NOT receive any review or updates from the Ubuntu security 
## team. 
deb http://us.archive.ubuntu.com/ubuntu/ hardy universe 
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe 

## Uncomment the following two lines to add software from the 'backports' 
## repository. 
## N.B. software from this repository may not have been tested as 
## extensively as that contained in the main release, although it includes 
## newer versions of some applications which may provide useful features. 
## Also, please note that software in backports WILL NOT receive any review 
## or updates from the Ubuntu security team. 
deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse 
# deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse 


deb http://security.ubuntu.com/ubuntu hardy-security main restricted 
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted 
# deb http://security.ubuntu.com/ubuntu dapper-security universe 
# deb-src http://security.ubuntu.com/ubuntu dapper-security universe 

更新: @在以下tux21b你的建議結果:

$ sudo apt-get install sun-java6-jre sun-java6-jdk 
[sudo] password for bobpete: 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
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
+0

啊,對不起。這個軟件包是「多元的」。我編輯了我的答案。 – tux21b 2010-02-16 01:45:44

回答

17

太陽的Java6斌不存在了,因爲它的內容現在在-jre包。只要仔細閱讀錯誤消息:

However the following packages replace it: 
    sun-java6-jre 
E: Package sun-java6-bin has no installation candidate 

只是一味不-bin包:

sudo apt-get install sun-java6-jre sun-java6-jdk 

編輯:對不起,我剛纔看到the package is in the "multiverse" section,所以你必須啓用前。 ..

你必須添加到你的sources.list中的行是:

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse 

然後,您可以執行apt-get update並重試安裝軟件包。

+1

添加多義線路工作。謝謝! – Lightbeard 2010-02-16 02:22:16

0

只嘗試..

sudo apt-get install sun-java6-jdk 

這應該安裝JRE和料箱的東西,依賴關係。

+1

同樣的結果:'E:包sun-java6-jdk沒有安裝應用程序' – Lightbeard 2010-02-16 01:38:42

9

作爲一個總noob我的自我。讓我放下這個很簡單,因爲我也爲此付出了努力。

爲了能夠使用「apt-get」命令安裝sun-java,您需要將一行添加到名爲「sources.list」的文件中。這行可以在/etc/apt/sources.list中找到。 通過編寫編輯:納米

比的(底部),該文件的最後,您複製/粘貼../etc/apt/sources.list行: DEB http://us.archive.ubuntu.com/ubuntu/頑強的多元宇宙

現在按Ctrl + X退出,「y」保存。

現在鍵入命令:apt-get的更新 當做到這一點,你可以成功運行命令: 命令和apt-get安裝太陽的Java6-jdk的

+0

非常棒!我不得不擊中'sudo nano ....' – gideon 2011-11-25 10:01:39

相關問題