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?

1

8 Answers 8

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
7
  • 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, 2012 at 6:52
  • Shorthand for sudo rm /Library/LaunchDaemons/org.jenkins-ci.plist
    – sti
    Jul 24, 2012 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, 2012 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, 2012 at 22:44
  • 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, 2013 at 16:25
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.

3
  • This helped a ton. I'm shocked that this information isn't more prevalent anywhere in Mac's documentation.
    – Makoto
    Feb 28, 2013 at 4: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, 2013 at 8:10
  • 1
    Thanks! Would be awesome if the OP could change the accepted answer for this one.
    – xmarcos
    Sep 4, 2013 at 2: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 :)

1
  • 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, 2015 at 12:15
7

run this on Terminal:

sh "/Library/Application Support/Jenkins/Uninstall.command"
1
  • 4
    As of May 2017 there isn't even a Jenkins folder in Application Support
    – brainray
    May 29, 2017 at 7:19
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.

3
  • Well, I was referring to scripts like the rc init scripts. If you haven't set up any, then just removing jenkins is enough.
    – carlspring
    Jul 23, 2012 at 11:34
  • I've installed it through Mac OS X installer, so not sure what did it create :|
    – jayarjo
    Jul 23, 2012 at 11:53
  • I recommend, you just delete the folders then. Let me know, if have any problems.
    – carlspring
    Jul 23, 2012 at 12:47
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.

1
  • 1
    There is no Jenkins version '1.5.39'. And this is only a incomplete copy of previous answers.
    – t0r0X
    Mar 22, 2015 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

1
  • Thanks!last three bullets should be piped. May 9, 2018 at 1:56
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.