Uninstall Applications with Command Line

Discussion in 'macOS' started by holden57, Aug 26, 2009.

  1. holden57 macrumors member

    Joined:
    Jul 18, 2009
    #1
    Does anyone know how to do this? I've installed many Applications (compiling from source) with the command line, but how do I uninstall them?
     
  2. MadGoat macrumors 65816

    MadGoat

    Joined:
    Jul 30, 2007
    Location:
    Canada
    #2
    Most apps if installed from source should have a "make uninstall" option within the source.
     
  3. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #3
    I assume you would have to be in the source directory which you installed it from to uninstall it? Because that would mean you would have to re-download things, which could be a pain
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    If the uninstall option doesn't exist for the app just use,

    Code:
    sudo mv app/location ~/.Trash
     
  5. Ishimaru macrumors 6502a

    Joined:
    Jun 18, 2009
    Location:
    Los Angeles
    #5
    Or rm -R Application.app and it's done! If it has an app associated with it of course :).
     
  6. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #6
    Usually I can't find the App, because I just install it, and access it from the command line. Sorry, I'm just trying to learn.
     
  7. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #7
    Right, but the programs I compile from source are usually random UNIX programs that don't have ***.app files, or if they do, I'm just ignorant of this fact lol
     
  8. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #8
    So pardon my ignorance here... you got far enough to download source and compile programs, yes? But you don't know where they are on your HD? :confused:

    After compilation, how exactly did you install the executable?

    Perhaps it would help if you gave us some examples... if these are relatively simple programs that just have an executable and no libraries strewn around, you can find where you put them like so... if your program is called sample,

    which sample
    (bash returns the location of the sample, like /usr/bin/sample)
    rm /usr/bin/sample (or wherever it is)

    or

    sudo rm /usr/bin/sample (if necessary).
     
  9. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    Well, live and learn. There could be some install logs that can tell you where files got put, but otherwise just try to make sure you have logs when you do the install (save your Terminal output as one easy option) so you know what all will need to be deleted later. There's not much else we can tell you, especially since we don't know what apps you installed.
     
  10. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #10
    I just did a 'make install' from the directory where the programs were, and I thought that was it. Maybe I've been doing it wrong. The program in question is 'links' I want to remove it now, but I'm not sure how. It's not a 'big' deal, but I just want to know how to do it. I'm just not sure where programs compiled from source like this reside.
     
  11. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #11
    ^^ sorry, I edited while you were typing this... I think the method listed above should work fine in this case.
     
  12. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #12
    What do you mean? Is it supposed to be in /usr/bin ?
     
  13. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #13
    He was providing an example. "which" is a Unix application. Doing which followed by an application name will tell you where that application resides on the HD. Though, it only works for apps that are on the path environment variable. If you know the name of the app you can potentially find the file using find.

    Code:
    cd /
    find . -name "app*.sh"
    The above would find all files that start with the letters "app" and have sh as an extension. The * being a wildcard for any character any number of times.
     
  14. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #14
    Right, sorry. To use which, you type which followed by the name of the program, e.g.

    which links

    Which will output the location at which the links executable is stored.

    I did omit the part about it needing to be in the PATH, but then, if the OP doesn't know where it is, I'm guessing it is in the path -- otherwise, how would he/she ever find it to use it? :D

    Now, sorry again to be semi-OT, but if you're talking about programs like links... these programs are miniscule. And they don't do anything unless invoked. Why even bother uninstalling them?
     
  15. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #15
    Merely, because I want to learn. That's it. I did a little research, and apparently, Mac OS does not have an uninstall function from the command line like many other UNIX OS, so it's impossible unless you use the 'make uninstall' function from the source, or you can manage to find where the application resides.
     
  16. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #16
    Ahh, I see what you're saying. Yes, in most Linux variants at least, there is some kind of package management system, like RPM (Redhat Package Manager) or APT (Advanced Packaging Tool) that manages the installation of applications, libraries, etc. It's frequently possible in the Linux world to have essentially everything except for the documents in the home directory managed as part of a package, including almost the whole OS, which is very clean.

    That's actually the same system the hackers implemented on the iPhone -- most of the jailbreak apps today are installed using Cydia, which is based on APT. (And Apple made their own system for the App Store)

    On Windows, too, applications are typically installed in such a way that they can be centrally uninstalled using Control Panel.

    For better or worse, OS X doesn't really have this either for command line programs like Links, or for graphical applications. (I personally think that Apple may ultimately try to bring something like the App Store model to OS X, but that's probably a ways off).

    Now, if you want Unix programs with package management, the place to go is Fink. Fink has both graphical and command line tools for Unix-style package management...

    http://finkcommander.sourceforge.net/

    And it has ports of many major Unix programs and utilities and so on.
     
  17. holden57 thread starter macrumors member

    Joined:
    Jul 18, 2009
    #17
    Thank you, yes I'm using MacPorts right now, and I do like that, but I was just wondering if there was a way outside of applications like that.
     

Share This Page