Install Jenkins in Ubuntu 18.04 LTS failed (Failed to start LSB: Start Jenkins at boot time.)

[Root cause]

  • Ubuntu 18.04 LTS use Java 9 as default java
  • Jenkins 2.107.2 still use Java 8

[Solution]

  • Install Java 8 before install Jenkins

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt install oracle-java8-installer
    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
    sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
    sudo apt-get update
    sudo apt install jenkins
    

  1. Install java 8
sudo apt install openjdk-8-jre
  1. Set default java version as java 8
sudo update-alternatives --config java
  1. Add the key
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
  1. Add repository
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
  1. Install jenkins
sudo apt install jenkins

Tags:

Ubuntu

Jenkins