Bootstrap

ubuntu安装jenkins(各种坑总结)

前提准备:安装jdk
在线安装jenkins:https://pkg.jenkins.io/debian-stable/
1、将存储库密钥添加到系统
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
添加密钥后,系统将返回OK
2、将Debian包存储库地址附加到服务器的sources.list :
echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
ps:协议是http
3、运行update ,以便apt-get将使用新的存储库
sudo apt-get update
执行时报错:
http://us.archive.ubuntu.com/ubuntu bionic InRelease Could not resolve ‘us.archive.ubuntu.com’
解决方案:使用163源mirrors.163.com或阿里源mirrors.cloud.aliyuncs.com,
修改/etc/apt/sources.list文件
再次执行还是报错
解决方案:
修改 resolv.conf 文件中的 nameserver 中的值
sudo vim /etc/resolv.conf
添加nameserver 8.8.8.8 ,保存后重启,/etc/init.d/networking restart
再次执行sudo apt-get update,成功
4、安装jenkins
sudo apt-get install jenkins
启动服务时报错:

;