Tuesday 5 December 2017

macos - How do you remove MacPorts and all the packages it has installed?


I have installed MacPorts on my Mac OS X Lion, and I would like to remove it. There should be no more trace of MacPorts?


Is there a way to do this?



Answer



From the manual, uninstalling MacPorts works as follows. You need to first uninstall all ports:


sudo port -fp uninstall --follow-dependents installed

If port is not found, try /opt/local/bin/port instead.


Also, to remove remainders of MacPorts, you will need to delete the following files by this single command (copy and paste line-by-line to Terminal):


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, and enter each line individually if you're unsure.


Note that MacPorts creates its own user and user group. They can be removed, too. See this answer over on Ask Different for more info.


Finally, each port installed through MacPorts may again create its own user and group, so you may have to perform a manual cleanup.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...