安装方法很简单: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