Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just bought fresh VPS with Ubuntu 10.10. I following this guide http://l2jserver.com/wiki/Setup_Server_-_Ubuntu for creating Lineage2 server, but this doesn't matter. I try to use command java -version and I got error:

-bash: java: command not found

If I skip this step and use this command (for install Java): sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk I got this error:

Unable to locate package sun-java6-bin
Unable to locate package sun-java6-jre
Unable to locate package sun-java6-jdk

What's wrong with It? Thank you for answers.

UPDATE #1

When I type: java -version

I got error: -bash: java: command not found

When I Type: sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner

I got error: sudo: add-apt-repository: command not found

When I type: sudo apt-get update

I got error:

Ign http://archive.ubuntu.com maverick Release.gpg
Ign http://archive.ubuntu.com/ubuntu/ maverick/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick/restricted Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick/universe Translation-en
Ign http://archive.ubuntu.com maverick-updates Release.gpg
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/restricted Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-updates/universe Translation-en
Ign http://archive.ubuntu.com maverick-security Release.gpg
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/main Translation-en
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/restricted Translation-e                                                                                                 n
Ign http://archive.ubuntu.com/ubuntu/ maverick-security/universe Translation-en
Ign http://archive.ubuntu.com maverick Release
Ign http://archive.ubuntu.com maverick-updates Release
Ign http://archive.ubuntu.com maverick-security Release
Ign http://archive.ubuntu.com maverick/main amd64 Packages
Ign http://archive.ubuntu.com maverick/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick/universe amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/main amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/universe amd64 Packages
Ign http://archive.ubuntu.com maverick-security/main amd64 Packages
Ign http://archive.ubuntu.com maverick-security/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick-security/universe amd64 Packages
Ign http://archive.ubuntu.com maverick/main amd64 Packages
Ign http://archive.ubuntu.com maverick/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick/universe amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/main amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick-updates/universe amd64 Packages
Ign http://archive.ubuntu.com maverick-security/main amd64 Packages
Ign http://archive.ubuntu.com maverick-security/restricted amd64 Packages
Ign http://archive.ubuntu.com maverick-security/universe amd64 Packages
Err http://archive.ubuntu.com maverick/main amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick/restricted amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick/universe amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-updates/main amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-updates/restricted amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-updates/universe amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-security/main amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-security/restricted amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
Err http://archive.ubuntu.com maverick-security/universe amd64 Packages
  404  Not Found [IP: 91.189.92.200 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/main/binary-a                                                                                                 md64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/restricted/bi                                                                                                 nary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/universe/bina                                                                                                 ry-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-updates/main/                                                                                                 binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-updates/restr                                                                                                 icted/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-updates/unive                                                                                                 rse/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-security/main                                                                                                 /binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-security/rest                                                                                                 ricted/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick-security/univ                                                                                                 erse/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.200 80]

E: Some index files failed to download, they have been ignored, or old ones used                                                                                                  instead.

My /etc/apt/sources.list looks like:

Anyone can help me?

share|improve this question

migrated from stackoverflow.com Mar 12 '13 at 2:08

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers 3

You need to uncomment the two lines in /etc/apt/sources.list that refer to "partner" Try :

sudo nano /etc/apt/sources.list

replace 'nano' with the installed text editor like vi etc.

uncomment the two lines referring to "partner", (remove the #)

If there's no repository, add one:

sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"  

Now,

sudo apt-get update 
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
share|improve this answer
    
In my sources.list are only 3 lines at all and there aren't commented lines : deb http://archive.ubuntu.com/ubuntu maverick main restricted universe deb archive.ubuntu.com/ubuntu maverick-updates main restricted universe deb http://archive.ubuntu.com/ubuntu maverick-security main restricted universe –  Rs Penki Mar 12 '13 at 0:16
    
If I type sudo nano /etc/apt/sources.list I got error: sudo: nano: command not found –  Rs Penki Mar 12 '13 at 0:17
    
If I open etc/apt/source.list by WinSCP this file doesn't have any commented lines, only 3 lines at all. I'm useing WinSCP and PuTTy and what you mean to replace with nano? –  Rs Penki Mar 12 '13 at 0:37
    
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner" sudo: add-apt-repository: command not found –  Rs Penki Mar 12 '13 at 0:40
    
'nano' and 'vi' are text editors for Ubuntu. What I mean by replace 'nano' in the command (when nano is not installed) is that you can instead use a command of the form: sudo <installed-text-editor> /etc/apt/sources.list , For Example: sudo vi /etc/apt/sources.list Where 'vi' is the name of installed text-editor. –  Ashwin Saxena Mar 12 '13 at 0:45
show 4 more comments

Try doing sudo apt-get install openjdk-6-jre, openjdk-6-bin, openjdk-6-jdk

share|improve this answer
    
Thank you for answer, but after this I got error: Unable to locate package openjdk-6-jre Unable to locate package openjdk-6-bin Package 'openjdk-6-jdk' has no installation candidate –  Rs Penki Mar 11 '13 at 23:54
add comment

i had this similar problem this is the problem of the frameworks(pythons,ruby,perl).so i changed the Ubuntu os to 12.04.so the best way to solve this case is the upgrading the os

share|improve this answer
add comment

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.