Upgrade Jenkins on Ubuntu 18.04 LTS

Upasana | September 30, 2020 | 1 min read | 7,924 views


In this short tutorial we will apply minor update to existing Jenkins installation on Ubuntu 18.04 LTS and Ubuntu 20.04 LTS machine.

Common location of jenkins war file on ubuntu server is:

/usr/share/jenkins

Update the installation

Jump to jenkins home directory
cd /usr/share/jenkins
Stop the jenkins server
sudo service jenkins stop
Move existing jenkins war file
sudo mv jenkins.war jenkins.war.old
Download latest jenkins war file
sudo wget https://updates.jenkins-ci.org/latest/jenkins.war
Start the Jenkins server
sudo service jenkins start

Everything should be good now.

Troubleshooting steps

If you are running jenkins using root permissions, (which you should not be doing), you need to change the jenkins.war permissions.

$ sudo chown root:root jenkins.war

You can optionally restart the jenkins server using below command:

$ sudo /etc/init.d/jenkins restart

If you are not able to find jenkins war file in standard path, you can goto Manage Jenkins → System Information, it will display the path to the .war file.

On ubuntu, you can also try the below two commands to update everything:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get update
$ sudo apt-get install jenkins

Top articles in this category:
  1. Install OpenJDK 11 on Ubuntu 18.04 LTS
  2. Upgrade MySQL from 5.7 to 8 on Ubuntu 18.04
  3. Install ElasticSearch 7 on Ubuntu 20.04
  4. Install & configure Redis on Ubuntu
  5. Install Cassandra 4 on Ubuntu 20.04
  6. Install RabbitMQ and Erlang 23 on Ubuntu 20
  7. Permanent swap space in Ubuntu

Recommended books for interview preparation:

Find more on this topic: