Server Fault is a question and answer site for system and network administrators. 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 using these commands to install JDK/JVM in Debian server:

apt-get install openjdk-jdk
apt-get install sun-java6-jdk

But getting lots of error:

 404 Not Found [IP: 80]
 404 Not Found [IP: 80]

I trying to install this by:

apt-cache search jdk
apt-get install sun-java6-jdk sun-java6-jre

But here also showing same problem.

Does anyone know what can be causing this problem?

share|improve this question
which mirror are you using? can you show contents of /etc/apt/sources.list? – DukeLion May 18 '12 at 7:34
Not following mirror? – Khoyendra Pande May 18 '12 at 8:08
Did you remember to run apt-get update first to refresh the package lists? – Janne Pikkarainen May 18 '12 at 8:32
Yeah I have used this before start JDK. – Khoyendra Pande May 18 '12 at 8:47
What version of Debian? – Tom O'Connor May 18 '12 at 12:48

make sure you have run apt-get update before anything else.

The package name you likely want is openjdk-6-jdk or openjdk-6-jre (depending on if you are compiling java or just running java.

Debian is no longer distributing sun-* java packages, as oracle has changed the distribution license in a way which makes it illegal for us to do so.

If this is still not working, please show us the output of apt-cache policy openjdk-6-jre

Another possibility is that you are running a no longer supported release of Debian, like lenny (5.0) or etch (4.0), which are no longer on the regular Debian mirrors, but on Those would have out-dated, security-vulnerable versions of the sun java packages. However, if this is the case, I'd expect the apt-get update command to also give 404 errors. And if this is your situation, my recommendation is to first upgrade to a currently supported release of Debian.


You comment confirms that you are running an outdated version of debian which is no longer supported and no longer carried on the main mirrors. Lenny has been moved to the archive mirror on On this archive, you will find old, known to be security-vulnerable versions of the JDKs. You could install these after changing to use the archive mirror, but my strong recommendation is to upgrade to the currently supported release by following the instructions in the chapter 4 of the squeeze release notes

share|improve this answer
I am getting this by apt-cache policy openjdk-6-jre --- instead. domU-12-31-39-07-4A-8D:~# apt-cache policy openjdk-6-jre openjdk-6-jre: Installed: (none) Candidate: 6b11-9.1+lenny2 Version table: 6b11-9.1+lenny2 0 500 lenny/updates/main Packages 6b11-9.1 0 500 lenny/main Packages – Khoyendra Pande May 18 '12 at 18:36
I have used "apt-get update" too but error not solving. – Khoyendra Pande May 18 '12 at 18:36
Hadn't thought of that--it's bitten me before, too! >.< – Vishal Kotcherlakota May 23 '12 at 23:13

Do you have network connectivity? It looks like you're having one of three problems.

  1. You don't have an internet connection. Ergo apt-get (or anything else that downloads files from the network) will not work.
  2. You're trying to download the packages from a mirror that's offline. Try checking this by using apt-get to download something else.
  3. It's possible (but unlikely) that your DNS cache is stale. Flush it using a guide like this one.

You may also be able to get the JDK in an offline form as a .deb package, and install it that way. You should be able to find what you'd need here. Once you download the .deb package, use the following command to install it:

 sudo dpkg -i packagename.deb

Where packagename.deb is the name of the package you'd like to install

share|improve this answer
Internet connection is fine every thing is running ok other then this. Just now I installed tomcat without any problem – Khoyendra Pande May 18 '12 at 7:58
I added an alternate way to get the package installed. – Vishal Kotcherlakota May 18 '12 at 8:20
showing this error- dpkg: error processing packagename.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: packagename.deb – Khoyendra Pande May 18 '12 at 8:33
I assumed you'd know that packagename.deb would be the name of the .deb file you want to install. Replace packagename.deb with the name of the JDK .deb file, and it will work. – Vishal Kotcherlakota May 18 '12 at 8:37
I'd recommend NOT going down this route. You should fix the underlying problem instead of working around it. The underlying problem is likely to be causing you to be missing out on security updates, and might just be coming up again the next time you are trying to install a package. – stew May 18 '12 at 13:22

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.