参考:https://www.myfreax.com/how-to-install-jenkins-on-ubuntu-18-04/

1. 安装java

  1. sudo apt update
  2. sudo apt install openjdk-8-jdk

2. 安装前准备

  1. # 导入Jenkins存储库的GPG密钥
  2. wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

image.png
将Jenkins存储库添加到系统中

  1. sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

3. 安装Jenkins

一旦启用Jenkins储存库,请更新apt软件包列表并通过键入以下内容安装最新版本的Jenkins

  1. sudo apt update
  2. sudo apt install jenkins

image.png

3. 重启

service jenkins restart