If you want to update your Jenkins to the desired version, then following script will help you to install the desired version of Jenkins by restarting it to the actual updated versions.
Create the scripting file using
nano updateJenkins.sh
Grant execute permissions to the file.
chmod +x updateJenkins.sh
Add the following content into your script.
#/bin/bash
echo "Enter the Jenkins Version you want to update:"
read version
wget http://updates.jenkins-ci.org/download/war/$version/jenkins.war
sudo cp jenkins.war /usr/share/jenkins/
sudo service jenkins restart
rm jenkins.war