Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zhadowz99/90dbe8f2e18c3adcb876ac9eea8dc3d8 to your computer and use it in GitHub Desktop.
Save zhadowz99/90dbe8f2e18c3adcb876ac9eea8dc3d8 to your computer and use it in GitHub Desktop.
How to update your Jenkins 2.176.x to 2.222.4 and java 8 to 11 in ubuntu 16.04 manually

How to update your Jenkins 2.176.x to 2.222.4 and java 8 to 11 in ubuntu 16.04 manually

This doc will tell you how to update your java to 11 and update Jenkins to version 2.222.4

  1. Make sure the jenkins run in the quite mode

    http://your_jenkins_url/quietDown
    
  2. Disconect all of your agent

  3. Stop the jenkins server

  4. Make backup of your server and agent

  5. Update the java 11 (in this case I use adpotopenjdk11)

    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo apt-get install -y apt-transport-https software-properties-common
    sudo apt-get install -y curl wget htop nano vim-tiny
    wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
    sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
    sudo apt-get update
    sudo apt-get install -y adoptopenjdk-11-hotspot
    
  6. Verify the java

    java -version
    javac -version
    

    If it's still using java8 you need to manually setup the java using alternatives

    update-java-alternatives --list
    update-java-alternatives --set adoptopenjdk-11-hotspot-amd64
    

    then check the java again

  7. Relaunch the jenkins and make sure the pipelines runs well

  8. Stop the jenkins server

  9. Updates the jenkins.war

    wget http://mirrors.jenkins.io/war-stable/2.222.4/jenkins.war
    

    Backup your old jenkins.war

    Then move the new jenkins.war into your jenkins.war folder

  10. Update your all of your agent java (you can use the same method as master)

  11. Relaunch the jenkins server

  12. Update all of your plugins

  13. Then make sure the pipeline is running well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment