171

This is probably very simple, but I can't find any hint anywhere. So how one is supposed to do that, in general and specifically on Mac?

Jost
  • 5,948
  • 8
  • 42
  • 72
jayarjo
  • 16,124
  • 24
  • 94
  • 138

8 Answers8

446

These instructions apply if you installed using the official Jenkins Mac installer from http://jenkins-ci.org/

Execute uninstall script from terminal:

'/Library/Application Support/Jenkins/Uninstall.command'

or use Finder to navigate into that folder and double-click on Uninstall.command.

Finally delete last configuration bits which might have been forgotten:

sudo rm -rf /var/root/.jenkins ~/.jenkins

If the uninstallation script cannot be found (older Jenkins version), use following commands:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm -rf /Applications/Jenkins "/Library/Application Support/Jenkins" /Library/Documentation/Jenkins

and if you want to get rid of all the jobs and builds:

sudo rm -rf /Users/Shared/Jenkins

and to delete the jenkins user and group (if you chose to use them):

sudo dscl . -delete /Users/jenkins
sudo dscl . -delete /Groups/jenkins

These commands are also invoked by the uninstall script in newer Jenkins versions, and should be executed too:

sudo rm -f /etc/newsyslog.d/jenkins.conf
pkgutil --pkgs | grep 'org\.jenkins-ci\.' | xargs -n 1 sudo pkgutil --forget
t0r0X
  • 4,212
  • 1
  • 38
  • 34
sti
  • 11,047
  • 1
  • 27
  • 27
  • I think it can be included into installer as an option, in customize section. Or I believe there should be some delete hooks, when user decides to drop application into trash bin. But what's that "sudo rm !$" for? – jayarjo Jul 24 '12 at 06:52
  • Shorthand for `sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist` – sti Jul 24 '12 at 20:29
  • 1
    I have never seen Mac applications uninstalled using a customized installation or by setting up a folder action for Trash. Can you point me to some examples of those? – sti Jul 24 '12 at 20:31
  • 41
    The above commands will be found in `/Library/Application Support/Jenkins/Uninstall.command` hopefully in a couple of weeks. – sti Jul 24 '12 at 22:44
  • Thank you so much for this! The fact that Jenkins comes with no way to uninstall on Mac is a complete travesty. – Zarkonnen Jan 05 '13 at 20:08
  • 1
    Since it looks like the Uninstall.command script is there now, it'd be good to update the first part of the answer with that (though having the info for folks with older installations is still very handy). – Alex Dixon Jan 21 '13 at 16:25
  • For anyone who is directly pasting the command to run the uninstall script, use the below command. `/Library/Application\ Support/Jenkins/Uninstall.command` – being_j Mar 08 '19 at 14:46
94

You are right, it is simple. Run (admin password required):

'/Library/Application Support/Jenkins/Uninstall.command'

It may be necessary to do this with admin privileges using sudo.

Jost
  • 5,948
  • 8
  • 42
  • 72
alexchernyy
  • 1,216
  • 10
  • 12
  • This helped a ton. I'm shocked that this information isn't more prevalent anywhere in Mac's documentation. – Makoto Feb 28 '13 at 04:23
  • 3
    I thought StackOverflow is the ipso facto default documentation for **everything** :) I've found more (case specific and most of the times better explained) answers here than most application documents :) – javatarz Jun 25 '13 at 08:10
  • 1
    Thanks! Would be awesome if the OP could change the accepted answer for this one. – xmarcos Sep 04 '13 at 02:48
21

Keep in mind, that in Terminal you need to add backslash before space, so the proper copy/paste will be

/Library/Application\ Support/Jenkins/Uninstall.command

p.s. sorry for the late answer :)

Lucifer
  • 480
  • 3
  • 12
  • I think this should be a comment (to which answer?). Thw two highest answers have quotes around the command to protect the space from interpretation of the shell. – Brandin Jul 16 '15 at 12:15
7

run this on Terminal:

sh "/Library/Application Support/Jenkins/Uninstall.command"
Alécio Carvalho
  • 13,481
  • 5
  • 68
  • 74
4

There is no uninstaller. Therefore, you need to:

  • Delete the directory containing Jenkins (or, if you're deploying the war -- remove the war from your container).

  • Remove ~/.jenkins.

  • Remove you startup scripts.

carlspring
  • 31,231
  • 29
  • 115
  • 197
2

My Jenkins version: 1.5.39

Execute steps:

Step 1. Go to folder /Library/Application Support/Jenkins

Step 2. Run Uninstall.command jenkins-runner.sh file.

Step 3. Check result.

It work for me.

Sanoob
  • 2,466
  • 4
  • 30
  • 38
PhungLe
  • 352
  • 3
  • 6
  • 1
    There is no Jenkins version '1.5.39'. And this is only a incomplete copy of previous answers. – t0r0X Mar 22 '15 at 14:31
2

Run the following commands to completely uninstall Jenkins from MacOS Sierra. You don't need to change anything, just run these commands.

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
sudo rm -rf /Applications/Jenkins '/Library/Application Support/Jenkins' /Library/Documentation/Jenkins
sudo rm -rf /Users/Shared/Jenkins
sudo rm -rf /var/log/jenkins
sudo rm -f /etc/newsyslog.d/jenkins.conf
sudo dscl . -delete /Users/jenkins
sudo dscl . -delete /Groups/jenkins
pkgutil --pkgs
grep 'org\.jenkins-ci\.'
xargs -n 1 sudo pkgutil --forget

Salam

Shah

Ugur Kazdal
  • 648
  • 8
  • 10
HA S
  • 1,129
  • 12
  • 10
0

On Mac; these two below commands completely remove Jenkins from your machine. just open your Terminal and execute them:

  1. '/Library/Application Support/Jenkins/Uninstall.command' and
  2. sudo rm -rf /var/root/.jenkins ~/.jenkins

Thanks

Tes
  • 151
  • 1
  • 7