Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
  404  Not Found [IP: 80]

W: Failed to fetch
  404  Not Found [IP: 80]

W: Failed to fetch
  404  Not Found [IP: 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
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 – Nitin Venkatesh 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
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 :) – Nitin Venkatesh Mar 2 '12 at 14:23
up vote 4 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

Your Answer


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.