9 Replies Latest reply: Jun 11, 2010 4:15 AM by sc0rioq8
sc0rioq8 Level 1 Level 1
Hi all

Is there any way to completely remove or uninstall an application ".dmg/pkg" using Terminal ?

I've searched google and only had got removing Files, Folders, Pictures ...etc

Waiting help


MacBook Pro, Mac OS X (10.5.8)
  • Kappy Level 10 Level 10
    Just locate the file/folder you wish to remove and enter:
    rm -rf filename or foldername
    Press RETURN

    If the item is in a system owned folder then precede the above command with sudo:
    sudo rm -rf filename or foldername
    You will be prompted to enter your admin password which will not be echoed.

    If you know where the item is located through the Finder or on the Desktop, then drag the item into the Terminal window immediately after "rm -rf ". Note there must be a space after "-rf".
  • BobHarris Level 6 Level 6
    And note, that "rm -rf" can also delete everything in your account, if you specify the wrong directory, or "sudo rm -rf" can delete your entire disk with the wrong directory.

    In otherwords, be careful what you wish for
  • sc0rioq8 Level 1 Level 1

    Thanks for the reply !

    Actually, I know all of those commands, what i need to know exactly is :

    Is there a specific command for uninstalling an application with all its contents such as [plists & Preference Panes]

    If i use the sudo command it will not remove the contents & files of the application.

    I need a command gives me the result just like the result given by (CleanApp,AppZapper,CleanMyMac)

    Thanks in advance
  • sc0rioq8 Level 1 Level 1
    Thanks for the information
  • Kappy Level 10 Level 10
    OK, I understand. I'm not aware of a terminal command to uninstall, and neither of the two related install commands have an uninstall parameter.

    Most of the GUI programs must be running before any installation so they are able to record what the software installs or they look to the use of the .pkg receipts in /Library/Receipts/ for what a particular program installed, but that only works if the program's installer created a receipt. Otherwise they are simply looking for files in the several specific locations commonly used - Preferences and Applications Support folders.

    If there is a terminal command to uninstall software it doesn't seem to appear as part of FreeBSD used in OS X. Perhaps there is a third-party implementation but I have no idea what that is or where it might be located.
  • sc0rioq8 Level 1 Level 1

    Thanks for your attention and for the information.

    actually, I am surprised that OS X has no way to do that !

    I hope some one over here has an idea about that ...
  • WZZZ Level 6 Level 6
    Mac OS X
    Not a direct answer, but to uninstall an app, what I find can be more effective -- if this is what is behind your question -- than the uninstaller programs like AppZapper etc., is to use EasyFind set to scan all files (including invisible). It looks everywhere for files. The only caution is to be sure to search using all possible names, in addition to the name itself, of the app, like the developer name or anything that might be associated. I'll usually catch everything that way. Only other caveat is to watch out for shared libraries or components in some of the more complicated apps. Obviously, you don't want to remove those.

    Also, some apps come with uninstallers, which you can often find from a control click on the app>Show Package Contents, or from the original installer.


  • Kappy Level 10 Level 10
    See my note:

    Uninstalling Software: The Basics

    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash. Applications may create preference files that are stored in the /Home/Library/Preferences/ folder. Although they do nothing once you delete the associated application, they do take up some disk space. If you want you can look for them in the above location and delete them, too.

    Some applications may install an uninstaller program that can be used to remove the application. In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.

    Some applications may install components in the /Home/Library/Applications Support/ folder. You can also check there to see if the application has created a folder. You can also delete the folder that's in the Applications Support folder. Again, they don't do anything but take up disk space once the application is trashed.

    Some applications may install a startupitem or a Log In item. Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder. Log In Items are set in the Accounts preferences. Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab. Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.

    Some software use startup daemons or agents that are a new feature of the OS. Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.

    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term. Unfortunately Spotlight will not look in certain folders by default. You can modify Spotlight's behavior or use a third-party search utility, Easy Find, instead. Download Easy Find at VersionTracker or MacUpdate.

    Some applications install a receipt in the /Library/Receipts/ folder. Usually with the same name as the program or the developer. The item generally has a ".pkg" extension. Be sure you also delete this item as some programs use it to determine if it's already installed.

    There are also several shareware utilities that can uninstall applications:
    Spring Cleaning

    Look for them at VersionTracker or MacUpdate.

    For more information visit The XLab FAQs and read the FAQ on removing software.
  • sc0rioq8 Level 1 Level 1
    @WZZZ : Thanks for sharing this

    @Kappy : Nice Note !! Thank you

    So, at first at last, i will have to use one of the shareware utilities to completely uninstall an application.

    I am frustrating & Thank you all