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

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/javasudo apt install oracle-java8-installerwget -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 updatesudo 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


Sometimes it also give an error due to some permission changed. You can try this:

chown root:root /tmpchmod ugo+rwXt /tmp