Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to cleanly remove all changes made by MacPorts as well as MacPorts itself, to try my luck with homebrew. How can I do that?

share|improve this question

The MacPort documentation advises to use your Terminal and type:
sudo port -fp uninstall installed

and with this command, all remaining items will be deleted:

sudo rm -rf /opt/local
sudo rm -rf /Applications/DarwinPorts
sudo rm -rf /Applications/MacPorts
sudo rm -rf /Library/LaunchDaemons/org.macports.*
sudo rm -rf /Library/Receipts/DarwinPorts*.pkg
sudo rm -rf /Library/Receipts/MacPorts*.pkg
sudo rm -rf /Library/StartupItems/DarwinPortsStartup
sudo rm -rf /Library/Tcl/darwinports1.0
sudo rm -rf /Library/Tcl/macports1.0
sudo rm -rf ~/.macports

Warning: Don't run a sudo command, especially a rm -rf one, unless you know what it's doing.

share|improve this answer
Just make absolutely sure the first line ends in a backslash and not a forward slash! – echristopherson Feb 22 '13 at 4:51
True that. I'll add it in my answer. – Michiel Feb 22 '13 at 7:31
I got this error Error: No ports matched the given expression when used sudo port -fp uninstall installed. What might be the possible reason? – ptamzz Mar 15 '14 at 18:32
thnaks for the answer, what I was looking for, I got from here. Great!!! – Amit Mar 3 at 18:59

Your Answer


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.