CentOS7.6 对应jenkins正常运行版本为 2.350, 对应java jdk环境为Java11
yum list installed | grep java
yum -y remove java-1.8.0-openjdk*
yum -y remove tzdata-java*
#删除原先版本的jenkins
systemctl stop jenkins.service
rpm -e jenkins
rpm -qa | grep jenkins # 查看是否还有jenkins依赖,有就删除
rm -rf /etc/sysconfig/jenkins.rpmsave
rm -rf /var/cache/jenkins/
rm -rf /var/lib/jenkins/
rm -rf /var/log/jenkins
rm -rf /usr/lib/jenkins
yum install java-11-openjdk.x86_64
wget https://pkg.jenkins.io/redhat/jenkins-2.350-1.1.noarch.rpm
rpm -ivh jenkins-2.350-1.1.noarch.rpm
chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
systemctl restart jenkins
chown -R jenkins /root
systemctl start jenkins
systemctl status jenkins
systemctl enable jenkins
systemctl restart jenkins