Question

Unable to install Jenkins due to java package can not be installed

Posted March 15, 2021 139 views
Ubuntu 18.04

Hi,

When I tried to install Java package that is required for Jenkins install I see the following error and there is no clue how to get unblocked from this error. OS on the droplet is Ubuntu 18.04.


$ sudo apt install default-jre
Reading package lists... Done
Building dependency tree       
Reading state information... Done
**E: Unable to locate package default-jre**

$ java --version

Command 'java' not found, but can be installed with:

sudo apt install openjdk-11-jre-headless  # version 11.0.7+10-2ubuntu2~19.10, or
sudo apt install default-jre              # version 2:1.11-72
sudo apt install openjdk-13-jre-headless  # version 13+33-1
sudo apt install openjdk-14-jre-headless  # version 14~18-1
sudo apt install openjdk-8-jre-headless   # version 8u252-b09-1~19.10

$ sudo apt install openjdk-11-jre-headless
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package openjdk-11-jre-headless
$ 
$ sudo apt install   openjdk-14-jre-headless
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package openjdk-14-jre-headless
$ 
$ sudo apt openjdk-8-jre-headless
E: Invalid operation openjdk-8-jre-headless
$ 

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi @bengaltiger,

The easiest option for installing Java is to use the version packaged with Ubuntu. By default, Ubuntu 18.04 includes OpenJDK version 11, which is an open-source variant of the JRE and JDK.

To install this version, first update the package index:

sudo apt update

After the update give

sudo apt install default-jre

Another try

Regards,
KFSys

  • Hello KFSys,

    Yes I tried that too yesterday but the result is same as above. Could you look at this result from my latest attempt.

    $ sudo apt update
    [sudo] password for xxxxx: 
    
    Ign:1 http://mirrors.digitalocean.com/ubuntu eoan InRelease
    Ign:2 http://mirrors.digitalocean.com/ubuntu eoan-updates InRelease
    Ign:3 http://mirrors.digitalocean.com/ubuntu eoan-backports InRelease
    Err:4 http://mirrors.digitalocean.com/ubuntu eoan Release
      404  Not Found [IP: 111111]
    Ign:5 http://security.ubuntu.com/ubuntu eoan-security InRelease
    Err:6 http://mirrors.digitalocean.com/ubuntu eoan-updates Release
      404  Not Found [IP: 111111 80]
    Err:7 http://mirrors.digitalocean.com/ubuntu eoan-backports Release
      404  Not Found [IP: 111111 80]
    Err:8 http://security.ubuntu.com/ubuntu eoan-security Release
      404  Not Found [IP: 111111 80]
    Ign:9 http://pkg.jenkins-ci.org/debian-stable binary/ InRelease
    Hit:10 http://pkg.jenkins-ci.org/debian-stable binary/ Release
    Reading package lists... Done
    E: The repository 'http://mirrors.digitalocean.com/ubuntu eoan Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.digitalocean.com/ubuntu eoan-updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.digitalocean.com/ubuntu eoan-backports Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://security.ubuntu.com/ubuntu eoan-security Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    $ 
    $ 
    $ sudo apt install default-jre
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package default-jre
    $ 
    
    

    Best regards