参考:https://www.myfreax.com/how-to-install-jenkins-on-ubuntu-18-04/
1. 安装java
sudo apt update
sudo apt install openjdk-8-jdk
2. 安装前准备
# 导入Jenkins存储库的GPG密钥
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
将Jenkins存储库添加到系统中
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
3. 安装Jenkins
一旦启用Jenkins储存库,请更新apt软件包列表并通过键入以下内容安装最新版本的Jenkins
sudo apt update
sudo apt install jenkins
3. 重启
service jenkins restart