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.

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
add comment

1 Answer

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
4  
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 at 18:32
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.