Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to install the java re and java dk in Ubuntu 10.04 LTS. I tried using this link ubuntu help java. I used the first link for installing and clicked yes. I was warned that some of the packages were not able to be downloaded. I click to proceed, and afterwards the following message was brought up as an error having occurred:

W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-6/openjdk-6-jre-lib_6b20-1.9.10-0ubuntu1~10.04.3_all.deb
  404  Not Found [IP: 91.189.92.167 80]


W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-6/openjdk-6-jre-headless_6b20-1.9.10-0ubuntu1~10.04.3_i386.deb
  404  Not Found [IP: 91.189.92.167 80]


W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-6/icedtea-6-jre-cacao_6b20-1.9.10-0ubuntu1~10.04.3_i386.deb
  404  Not Found [IP: 91.189.92.167 80]

I went to the terminal and used java -version to get this output:

alex@alex-laptop:~$ java -version
The program 'java' can be found in the following packages:
 * gcj-4.4-jre-headless
 * openjdk-6-jre-headless
 * cacao
 * gij-4.3
 * jamvm
Try: sudo apt-get install <selected package>

This was the same output as before though. I subsequently tried to install via the synaptic package manager choosing default-jre-headless 1.6-34 which included the openjdk-6-jre-headless as well as other packages. This gave me the same errors as before using the web install.

Was the installation aborted due to these errors? If these failed are alternative download methods or is the error from my connection or system configuration? How to then proceed with installing java RE and then java DK?

Or is it simply a server/connection problem that will get fixed in time and I should try again later?

UPDATE:I ran sudo apt-get install openjdk-6-jre-headless and the installation failed again giving E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

share|improve this question
1  
As the error message suggest, please run sudo apt-get update && sudo apt-get install --fix-missing and then try sudo apt-get install openjdk-6-jre-headless –  nitstorm Mar 2 '12 at 13:57
    
@nitstorm, thanks, that worked: alex@alex-laptop:~$ java -version java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1) OpenJDK Server VM (build 19.0-b09, mixed mode) could you put your comment as an answer to give you the credit due? Does this output mean that the java development kit is also included? Do I need to now install that separately? –  Vass Mar 2 '12 at 14:17
1  
Cool :) Posted as answer :) Not sure, but I don't think JDK got installed, coz it states OpenJDK Runtime Environment but as I said, I am not 100% sure. This answer should prove useful for you at this stage :) –  nitstorm Mar 2 '12 at 14:23
add comment

1 Answer 1

up vote 2 down vote accepted

As suggested in the console messages, please run

sudo apt-get update
sudo apt-get install --fix-missing
sudo apt-get install openjdk-6-jre-headless

That should most definitely fix the problem :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.