Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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!

share|improve this question
    
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/unins‌​talld and a matching plist in /System/Library/LaunchDaemons/com.apple.uninstalld.plist –  chillin May 3 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 May 3 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 May 3 at 4:49
    
@chillin Well, maybe it needs to be globalized for Launchpad, etc? –  0942v8653 May 4 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) –  Hawken Rives May 5 at 2:16
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Interesting! Thanks for the investigation. (I wish it'd work for non-MAS apps, though.) –  Hawken Rives Jun 19 at 15:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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