E: unable to locate package openjdk-8-jdk in ubuntu 20.04

Dung Do Tien Aug 29 2021 44

Hi guys, I just created a VPS in AWS EC2 and I want to install Elastic Search and Kibana. First, I try to install java 8 JDK as command below

 sudo apt-get install openjdk-8-jdk

But I get an error  E: unable to locate package openjdk-8-jdk.

 E: unable to locate package openjdk-8-jdk

I'm using Linux Ubuntu 20.04. Thanks for any suggestions.

Have 3 answer(s) found.
  • N

    Nguyen Truong Giang Aug 29 2021

    I got the same error and I tried to update apt-get by using the  sudo apt-get update command and after the try re-run  sudo apt-get install openjdk-8-jdk command. And it worked for me.

  • P

    Phuong Phan Aug 29 2021

    You can try to install step by step as below

    • Step 1: sudo add-apt-repository ppa:webupd8team/java
    • Step 2: sudo apt-get update
    • Step 3: sudo apt-get install oracle-java8-installer
    • Step 4: sudo apt-get install openjdk-8-jdk

    I hope it works for you.

  • s

    susmasagar bhattarai Aug 29 2021

    It might be OpenJDK8 is not included in your OS.  Try to install as below:

     sudo add-apt-repository ppa:openjdk-r/ppa
    sudo apt-get update
    sudo apt-get install openjdk-8-jre 
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close