I'm trying to install Jenkins using this tutorial:
https://phoenixnap.com/kb/install-jenkins-ubuntu
but I get:
root@server:~# sudo apt install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
jenkins is already the newest version (2.319.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up jenkins (2.319.2) ...
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 2022-01-30 16:41:35 UTC; 16ms ago
Docs: man:systemd-sysv-generator(8)
Process: 1457069 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
Jan 30 16:41:35 datalis systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 30 16:41:35 datalis jenkins[1457069]: Found an incorrect Java version
Jan 30 16:41:35 datalis jenkins[1457069]: Java version found:
Jan 30 16:41:35 datalis jenkins[1457091]: java version "17.0.1" 2021-10-19 LTS
Jan 30 16:41:35 datalis jenkins[1457091]: Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Jan 30 16:41:35 datalis jenkins[1457091]: Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
Jan 30 16:41:35 datalis jenkins[1457069]: Aborting
Jan 30 16:41:35 datalis systemd[1]: jenkins.service: Control process exited, code=exited, status=1/FAILURE
Jan 30 16:41:35 datalis systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jan 30 16:41:35 datalis 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)
root@server:~# ^C
root@server:~#
Do you know how I can fix this?