Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to install java on my debian machine, and have found several how to's but

sudo apt-get install java-package

gives me "Couldn't find package java-package". Do I need to add a repository in my /etc/apt/sources.list file? Here are the current repos i have.

tone@homeserver:/etc/apt$ cat /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 5.0.4 _Lenny_ - Official amd64 CD Binary-1 20100131-21:33]/ lenny main

deb cdrom:[Debian GNU/Linux 5.0.4 _Lenny_ - Official amd64 CD Binary-1 20100131-21:33]/ lenny main

deb http://ftp.us.debian.org/debian/ lenny main
deb-src http://ftp.us.debian.org/debian/ lenny main

deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main
tone@homeserver:/etc/apt$
share|improve this question

2 Answers 2

up vote 1 down vote accepted

You need to add contrib to your package list. So:

deb http://ftp.us.debian.org/debian/ lenny main contrib
deb-src http://ftp.us.debian.org/debian/ lenny main contrib
share|improve this answer
    
Hmm... I added those and double checked spelling, etc but still get same message –  Tone Jul 22 '10 at 12:30
    
Did you run apt-get update after adding it? packages.debian.org/lenny/java-package says it's part of contrib, so it should do it. –  user4253 Jul 22 '10 at 15:39
    
yup that did it! thanks! –  Tone Jul 22 '10 at 16:53

The packages for sun jdk/jre on debian are named sun-java$version-*, if you want to install the sun java 5 jre then its sun-java5-jre that will install the necessary packages.

You can find packages for debian usint their package search site that helps a lot.

EDIT: also, if you search the site I linked above you will see that sun-java packages are on the non-free suite, and you need to add then to your apt sources file.

share|improve this answer

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.