按照下面提到的链接尝试安装jenkins,但最终遇到以下问题
https://www.liquidweb.com/kb/installing-jenkins-on-ubuntu-16-04/
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code
再次重新安装dpkg并尝试安装jenkins,但最终遇到相同的问题
Could someone please guide me to resolve this issue?
uday@uday:~$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
jenkins is already the newest version (2.204.1).
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic
linux-image-4.4.0-57-generic
linux-image-extra-4.4.0-57-generic snapd-login-service
Use 'sudo apt autoremove' to remove them.
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] Y
Setting up jenkins (2.204.1) ...
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; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-12-22 20:09:44 IST; 4ms ago
Docs: man:systemd-sysv-generator(8)
Process: 31293 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
Dec 22 20:09:44 uday jenkins[31293]: Found an incorrect Jav...
Dec 22 20:09:44 uday jenkins[31293]: Java version found:
Dec 22 20:09:44 uday jenkins[31293]: java version "1.7.0_95"
Dec 22 20:09:44 uday jenkins[31293]: OpenJDK Runtime Enviro...
Dec 22 20:09:44 uday jenkins[31293]: OpenJDK Server VM (bui...
Dec 22 20:09:44 uday jenkins[31293]: Aborting
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Control p...
Dec 22 20:09:44 uday systemd[1]: Failed to start LSB: Start...
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Unit ente...
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Failed wi...
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package jenkins (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)
试图获取journalctl -xe命令的输出以观察该问题
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit jenkins.service has begun starting up.
Dec 23 08:21:32 uday jenkins[3105]: Found an incorrect Java version
Dec 23 08:21:32 uday jenkins[3105]: Java version found:
Dec 23 08:21:32 uday jenkins[3105]: java version "1.7.0_95"
Dec 23 08:21:32 uday jenkins[3105]: OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-3)
Dec 23 08:21:32 uday jenkins[3105]: OpenJDK Server VM (build 24.95-b01, mixed mode)
Dec 23 08:21:32 uday jenkins[3105]: Aborting
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Control process exited, code=exited status=1
Dec 23 08:21:32 uday systemd[1]: Failed to start LSB: Start Jenkins at boot time.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit jenkins.service has failed.
--
-- The result is failed.
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Unit entered failed state.
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Failed with result 'exit-code'.
Dec 23 08:21:33 uday sudo[3002]: pam_unix(sudo:session): session closed for user root
Dec 23 08:21:43 uday sudo[3170]: uday : TTY=pts/1 ; PWD=/home/uday ; USER=root ; COMMAND=/bin/journalctl -xe
Dec 23 08:21:43 uday sudo[3170]: pam_unix(sudo:session): session opened for user root by (uid=0)
~
答案 0 :(得分:0)
我认为Jenkins的新版本仅支持OpenJDK-8,因此您应该清理所有已安装的Java和Jenkins,然后根据此帖子https://techpostal.blogspot.com/2020/01/jenkins-installation-in-ubuntu-1804.html进行重新安装,希望它会为您提供帮助。