

If, like me, you’re tired of having to do it by hand, then here’s a short shell script I wrote that can do all that for you. If you like doing that, then by all means keep doing so. So, I used to manually traverse down the dependency tree and uninstall the leaf nodes (ports with no dependents) one by one until I could uninstall the ‘root’ port that I wanted to uninstall in the first place. Of course, you can force uninstall a port but MacPorts themselves warn us that doing so might cause problems later on (when rebuilding the dependents). (If you’re a developer on OS X and you don’t use MacPorts, then you probably should.)Įven when using a friendly GUI like, say, Porticus, you’re prevented from uninstalling a port with dependents. If you use MacPorts, then at some point you’ve probably tried to uninstall a port that had other ports as dependents. Maybe I’ll make a new post on that one-after making sure it’s also not already available as some hidden option. (I have another script that does the inverse-traverses up the dependency chain removing ‘leaf’ nodes-that is, ports with no further dependencies. So use that instead, and read on only if you like bash. Sudo port uninstall -follow-dependents portname Read 2.5 Uninstall from the MacPorts Guide you want to uninstall MacPorts itself.ĮDIT: steve k wrote in and opened my eyes to: Before we begin, I seem to be getting a lot of people visiting this post when searching for “uninstall macports”.
