Установка Jenkins не удалась в Ubuntu 20.04 с dpkg: ошибка обработки пакета jenkins (--configure)
Я пытался установить на свой сервер с помощью следующих команд
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
Но установка не удалась с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)
Я попробовал это, удалив и снова установив , изменив содержимое/etc/securetty
здесь , но ни один из них не работает. Я сталкиваюсь с этой проблемой только при попытке установитьJenkins
на сервере, пока я пытался установить свой ноутбук, имеяUbuntu 20.04
он работает нормально.
2 ответа
$ sudo apt update
$ sudo apt install openjdk-11-jre
$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)
$ sudo apt-get install jenkins
Официальные документы: https://www.jenkins.io/doc/book/installing/linux/#installation-of-java https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Использование Java 8
sudo apt install openjdk-8-jdk
Использование Java 11
sudo apt remove jenkins
sudo apt install openjdk-11-jdk
sudo apt install jenkins