2

I'm extremely new to linux and wanted to run a server but the program want to run requires linux.

Im trying to run this command via ssh to my server but receive this every time.

sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre

But I reccieve this.

user@serverubuntu:~$ sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre
[sudo] password for user: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package sun-java6-bin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-bin' has no installation candidate
E: Package 'sun-java6-jdk' has no installation candidate
E: Package 'sun-java6-jre' has no installation candidate
user@serverubuntu:~$ sudo apt-get install sun-java7-bin sun-java7-jdk sun-java7-jre
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package sun-java7-bin
E: Unable to locate package sun-java7-jdk
E: Unable to locate package sun-java7-jre
user@serverubuntu:~$

Sorry Im extremely new to linux and dont know how to do much.

Thanks :)

7

The official java packages has been removed from the Ubuntu repositories. You can install open-jdk instead:

sudo apt-get install openjdk-7-jdk

If you need the real thing you need to install the oracle java package:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
1

as i know you must find/add repositories to your system and then install it.

This may mean that the package is missing, has been obsoleted, or is only available from another source

Type this on google search and try to find some ways to fix this issue. You must read a lot firs before doing an action on linux.

For now this. I'll try to find something and post here again.

Good luck.

1

Here are some instructions for Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Then you can check your Java version with: java -version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.