https://pkg.jenkins.io/debian/
install
This is the Debian package repository of Jenkins to automate installation and upgrade. To use this repository, first add the key to your system:
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
Then add a Jenkins apt repository entry:
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
Update your local package index, then finally install Jenkins:
sudo apt-get update
sudo apt-get install fontconfig openjdk-11-jre
sudo apt-get install jenkins
The apt packages were signed using this key:
pub rsa4096 2020-03-30 [SC] [expires: 2023-03-30]
62A9756BFD780C377CF24BA8FCEF32E745F2C3D5
uid Jenkins Project
sub rsa4096 2020-03-30 [E] [expires: 2023-03-30]
upgrade
https://cloud.tencent.com/developer/article/1860268
下载更新版本
https://get.jenkins.io/war-stable/
确认安装路径
[主页]->[Manage Jenkins]->[System Information]
可以看到安装路径为 /usr/lib/jenkins/jenkins.war
停止服务
主页面会提示 Jenkins is going to shut down
然后在没有运行任务的情况下安全地停止 Jenkins 服务
[root@much tmp]# ps faux | grep jenkins -i
root 3269 0.0 0.0 112648 1028 pts/0 S+ 18:03 0:00 | \_ grep --color=auto jenkins -i
jenkins 1630 2.7 17.6 3720188 714756 ? Ssl 16:36 2:24 /etc/alternatives/java -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib/jenkins/jenkins.war --logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
[root@much tmp]# systemctl stop jenkins
备份和替换 WAR
[root@much tmp]# cd /usr/lib/jenkins/
[root@much jenkins]# mv jenkins.war jenkins.war.old.20180120
[root@much jenkins]# cp /root/jenkins.war .
启动服务
[root@much jenkins]# systemctl start jenkins
[root@much jenkins]# systemctl status jenkins
标签:--,war,much,jenkins,Jenkins,Packages,root,Debian
From: https://www.cnblogs.com/wl30564/p/16992307.html