0

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$

2 Answers 2

1

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
2
  • Hmm... I added those and double checked spelling, etc but still get same message
    – Tone
    Jul 22, 2010 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, 2010 at 15:39
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .