3

I have a hudson installed in server's /var/lib/hudson directory. when I access jenkins through URL in my browser,, I see the version 1.411 in the bottom of the page.

Does anybody know how to update Jenkins through command line (CLI). if its possible.

When I go to Manage Jenkins page , it says something like : "New version of Jenkins (1.521) is available for download (changelog)."

I dont feel safe with downloading the new jar and extract that in the server.

Ashish
  • 1,093
  • 1
  • 14
  • 24

2 Answers2

9

Are you referring to the Jenkins CLI, or the CLI on your operating system ? There is no way to update the Jenkins version via the Jenkins CLI.

If you installed Jenkins as a standalone WAR file, all you need to do to upgrade it from the command line is to download the new Jenkins WAR file and replace your current WAR file, then restart Jenkins. It's always a good idea to back up the full contents of your $JENKINS_HOME directory before upgrading.

If you used a native package such as an RPM or DEB, you should use the package manager on your Jenkins server (yum, apt-get etc.) to upgrade Jenkins.

gareth_bowles
  • 20,301
  • 5
  • 56
  • 81
  • I guess , this answers my question. – Ashish Jul 02 '13 at 20:09
  • Thanks a lot, I still have a question about updating GitHub plugin. Everytime I do an update plugin such as GitHub and restart the jenkins, Jenkins start crashing. when I try to access jenkins through URL in my browser, the error page shows up with some exception "class not found jenkins/model jenkins" . and then in order to make jenkins working again , I have to delete the plugin entirely from the plugins directory. I wish someone has an answer for this because I really need to make my github projects available to jenkins for build. Thanks – Ashish Jul 02 '13 at 20:14
  • I'd recommend asking about the plugin problem as a separate question. Take a look in your Jenkins log, too - it may give you some clues. – gareth_bowles Jul 02 '13 at 20:23
  • here is the question, sorry abt tht---> http://stackoverflow.com/questions/17435308/jenkins-crashes-after-installing-github-plugin – Ashish Jul 02 '13 at 20:30
1

Since the accepted answer doesn't tell much about upgrading Jenkins by logging into the server itself, I will add how to do that in a server that uses apt package manager.

After logging into the server, type the following command to list down all the packages that are upgradable.

apt list --upgradable 

You should get an output like this:

Listing... Done
iproute2/bionic-updates 4.15.0-2ubuntu1.3 amd64 [upgradable from: 4.15.0-2ubuntu1.2] jenkins/binary 2.277.1 all [upgradable from: 2.263.4]

If Jenkins is in the output list, just simply run the upgrade with the following command:

apt upgrade jenkins 
Sandun
  • 355
  • 2
  • 8
  • 19