1

I was trying to install Jenkins in my server Ubuntu 20.04 with the following commands

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins

But installation fails with dpkg: error processing package jenkins (--configure):

Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - LSB: Start Jenkins at boot time
     Loaded: loaded (/etc/init.d/jenkins; generated)
     Active: failed (Result: exit-code) since Sun 2021-01-24 20:09:16 UTC; 13ms ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1620107 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)

Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 jenkins[1620107]: ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 jenkins[1620107]: If you actually have java installed on the system make sure the executable is in the aforementioned path and that 'type -p java' returns the java executable path
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: jenkins.service: Control process exited, code=exited, status=1/FAILURE
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jan 24 20:09:16 ubuntu-s-1vcpu-1gb-nyc3-01 systemd[1]: Failed to start LSB: Start Jenkins at boot time.
dpkg: error processing package jenkins (--configure):
 installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried this, removing and again installation, changing the content of /etc/securetty here but none of them is working. I'm only facing this problem when I try to install Jenkins in server, while I tried to install my own laptop having Ubuntu 20.04 it works fine.

1 Answers1

0

Using Java 8

sudo apt remove jenkins

sudo apt install openjdk-8-jdk

sudo apt install jenkins

Using Java 11

sudo apt remove jenkins

sudo apt install openjdk-11-jdk

sudo apt install jenkins

Stophr
  • 41
  • 1
  • 4
  • This does not help for my situation. I could have other issues on my system. – Kemin Zhou Jul 15 '22 at 22:40
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 23 '22 at 06:01