I'm trying to upgrade my java version from 1.6 to 1.8. I followed these steps:

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

but when I typed the last command sudo apt-get install oracle-java8-installer I got this response :

E: Unable to locate package oracle-java8-installer

How do I fix this problem?

marked as duplicate by N0rbert, karel, Kulfy, Eliah Kagan, Eric Carvalho Jul 29 at 13:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    You didn't tell us your release, but is your release supported by that PPA? PPA's are 3rd party (personal package archives) sources for software so security, fitness for purpose & maintenance falls on you to check? ie. are they maintained, support your release, trustworthy etc – guiverc Jul 23 at 11:50
  • 1
    ubuntuupdates.org/ppa/webupd8_java → 3rd Party Repository: Webupd8 Java → This repository is available for: Precise Trusty Xenial Bionic Cosmic (I.e. 19.04 and non supported versions: not available.) – Knud Larsen Jul 23 at 12:08
  • I deleted java 1.6 then i install the java 1.8 using the link that u provide but I still have the same result when I typed : sudo apt-get install oracle-java8-installer that is " Unable to locate package oracle-java8-installer" – suzan Jul 23 at 20:19