6

There's a /usr/sbin/uninstall command on my system. What does it do? There is no man page, and running it says

  1. "You must be root to run this tool.",
  2. and (after sudo uninstall -h) it says "URL is not uninstallable: -h".

If I just run sudo uninstall, it says "uninstall file_urls ..."

I'm curious!

5
  • idk what it is, but have a little bit more information. The command first appears in 10.7 Lion, and there is also a framework and daemon in /System/Library/PrivateFrameworks/Uninstall.framework/Versions/A/Resources/uninstalld and a matching plist in /System/Library/LaunchDaemons/com.apple.uninstalld.plist
    – chillin
    Commented May 3, 2014 at 0:00
  • My guess is for the Mac App Store (especially with a daemon) ... but I really don't have any evidence to back that up.
    – 0942v8653
    Commented May 3, 2014 at 0:40
  • That was my guess as well, but App Store appeared in Snow Leopard with a couple daemons that could handle that, and uninstall did not appear in any update for Snow Leopard, which still uses App Store (unless you do as I do and disable it). This does not preclude the possiblity, and it is still my strong suspicion... but I have no evidence.
    – chillin
    Commented May 3, 2014 at 4:49
  • @chillin Well, maybe it needs to be globalized for Launchpad, etc?
    – 0942v8653
    Commented May 4, 2014 at 22:17
  • @people I've tried com.apple.[etc]-style (aka Java-style) URLs, but it didn't take them. It also doesn't take iTunes web links, nor the Mac App Store links (my chosen test url: macappstores://itunes.apple.com/us/app/caffeine/id411246225, for Caffiene) Commented May 5, 2014 at 2:16

1 Answer 1

3

0942v8653's guess is right, /usr/sbin/uninstall is a command line uninstaller for Mac App Store apps.

The file URL must be specified as parameter. In my tests the path to the application did it:

$ sudo /usr/sbin/uninstall /Applications/Reeder.app
Preparing Uninstall...
Uninstall Began...
7%...
15%...
(...)
92%...
100%...
Uninstall Ended...

while non-Mac App Store apps couldn't be uninstalled:

$ sudo /usr/sbin/uninstall /Applications/Seashore.app 
URL is not uninstallable: /Applications/Seashore.app

Interestingly, although I ran the command with sudo it still asked me for administrator credentials:

enter image description here

/usr/bin/uninstall uses the Uninstall private framework:

$ otool -L /usr/sbin/uninstall 
/usr/sbin/uninstall:
(...)
    /System/Library/PrivateFrameworks/Uninstall.framework/Versions/A/Uninstall (compatibility version 1.0.0, current version 202.0.0)
(...)

just like the Dock:

$ otool -L /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock | grep Uninstall
    /System/Library/PrivateFrameworks/Uninstall.framework/Versions/A/Uninstall (compatibility version 1.0.0, current version 202.0.0)

That makes sense, because my tests showed that when an application is uninstalled inside Launchpad (by clicking the app’s delete button that appears when icons wiggle) uninstall is not used, but the Dock.

1
  • Interesting! Thanks for the investigation. (I wish it'd work for non-MAS apps, though.) Commented Jun 19, 2014 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .