忍者ブログ

ひつ(じのひよこが)プログラミングします。
お仕事や趣味で困ったこととか、何度も「あれ?どうだったかしら」と調べたりしたこととか、作ったものとか、こどものこととかを書きます
★前は週末定期更新でしたが今は不定期更新です

2024/04    03« 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  »05

(当たり前のことだけど) Jenkins を入れる前に Java を入れよう

会社の PC (Ubuntu) に Jenkins を入れようとした。が、うまくいかない。E: Sub-process /usr/bin/dpkg returned an error code (1) と怒られる。

$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
jenkins is already the newest version (2.121.1).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-101 linux-headers-4.4.0-101-generic linux-headers-4.4.0-104 linux-headers-4.4.0-104-generic
  linux-headers-4.4.0-108 linux-headers-4.4.0-108-generic linux-headers-4.4.0-109 linux-headers-4.4.0-109-generic
  linux-headers-4.4.0-112 linux-headers-4.4.0-112-generic linux-headers-4.4.0-119 linux-headers-4.4.0-119-generic
  linux-headers-4.4.0-121 linux-headers-4.4.0-121-generic linux-headers-4.4.0-124 linux-headers-4.4.0-124-generic
  linux-image-4.4.0-101-generic linux-image-4.4.0-103-generic linux-image-4.4.0-104-generic
  linux-image-4.4.0-108-generic linux-image-4.4.0-109-generic linux-image-4.4.0-112-generic
  linux-image-4.4.0-119-generic linux-image-4.4.0-121-generic linux-image-4.4.0-124-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 148 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.121.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.
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)

ログから何となくわかる通り、Jenkins の設定中にうまくいかなかったようだ。

$ dpkg -l jenkins
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version          Architecture     Description
+++-=======================-================-================-===================================================
iF  jenkins                 2.121.1          all              Jenkins is an open source automation server which e

原因は /var/log/syslog を確認したらすぐに分かった。No Java executable found in current PATH だそうだ。apt 実行時のログに出ないのでスッと分からなかったが、冷静に考えればそりゃそうである。

$ cat syslog
 systemd[1]: Starting LSB: Start Jenkins at boot time...
 jenkins[22149]: ERROR: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin
 jenkins[22149]: 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
PR

コメント

ただいまコメントを受けつけておりません。

ブログ内検索

P R