ubuntu 16.04 安裝 Jenkins

安裝方法很簡單:java

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

若是在執行 sudo apt-get install jenkins中出現以下報錯:ubuntu

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 Wed 2019-01-30 22:39:31 PST; 14ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13548 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)

Jan 30 22:39:31 ubuntu systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 30 22:39:31 ubuntu jenkins[13548]: ERROR: No Java executable found in current P...in
Jan 30 22:39:31 ubuntu jenkins[13548]: If you actually have java installed on the s...th
Jan 30 22:39:31 ubuntu systemd[1]: jenkins.service: Control process exited, code=e...s=1
Jan 30 22:39:31 ubuntu systemd[1]: Failed to start LSB: Start Jenkins at boot time.
Jan 30 22:39:31 ubuntu systemd[1]: jenkins.service: Unit entered failed state.
Jan 30 22:39:31 ubuntu systemd[1]: jenkins.service: Failed with result 'exit-code'.
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
Processing triggers for systemd (229-4ubuntu21.4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)

說明Jenkins沒有在/usr/bin下找到jdk相關文件。能夠經過建立軟連接解決此問題。瀏覽器

sudo ln -s /jdk安裝文件/ /usr/bin/java

在執行sudo apt-get install jenkins就算是安裝完了。post

瀏覽器輸入「address:8080」,會顯示以下頁面: !code

administrator password能夠根據提示經過cat /var/lib/jenkins/secrets/initiaAdminPassword 獲取blog

配置完成後若是出現不顯示頁面(頁面空白)的狀況,百度說是配置權限,可是我這邊重啓下就行了,沒明白爲啥ip

相關文章
相關標籤/搜索