Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 a base edition of Debian and am trying to install Java 7 on it using this command:

root@server:~# apt-get install openjdk-7-jdk

However, I end up getting this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-7-jdk

It seems like the package is not in the repository, so I am not sure how to proceed.

share|improve this question

Try a quick apt-get update to get the latest package lists from repos, and then apt-cache search openjdk to check out what the latest offered version is that's available to you, if any are.

Most likely if this is a fresh base install you're going to have to go into your /etc/apt/sources.list and make sure you have the non-free package lists enabled, which aren't enabled by default in Debian I believe. So check this How do I enable non-free packages on Debian?

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.