Uninstalling MacPorts

Ryan Schmidt ryandesign at macports.org
Fri Oct 24 01:04:32 PDT 2008


We have uninstall instructions here:

http://trac.macports.org/wiki/FAQ#HowdoIremoveoruninstallMacPorts

They say:

> MacPorts can be removed by issuing the following command from  
> within Terminal using the regular bash shell (${prefix} being the  
> directory onto which you installed MacPorts, /opt/local by default):
>
> sudo rm -rf ${prefix} \
> /Applications/MacPorts \
> /Applications/DarwinPorts \
> /Library/Tcl/macports1.0 \
> /Library/Tcl/darwinports1.0 \
> /Library/LaunchDaemons/org.macports.* \
> /Library/StartupItems/DarwinPortsStartup \
> /Library/Receipts/MacPorts*.pkg \
> /Library/Receipts/DarwinPorts*.pkg \
> /etc/manpaths.d/macports \
> /etc/paths.d/macports


Problems:

1. This doesn't uninstall ports that install into weird locations,  
like those that install into ${x11prefix}. This is mentioned later in  
the FAQ entry.
2. It doesn't take into account that users can install the  
macports1.0 Tcl package into a different location.
3. It doesn't take into account that users can as of MacPorts 1.7.0  
select a different applications directory.
4. It doesn't uninstall frameworks installed by MacPorts. Those have  
until now gone into /Library/Frameworks which can also contain non- 
MacPorts items. In 1.7.0, the frameworks directory is also user- 
configurable.
5. It does uninstall user configuration files.

To take care of 1, 3, 4, and 5, maybe we should tell people to run  
"sudo port -f uninstall installed" first. Then look through ${prefix}  
for any remaining non-port-owned files they may still want to keep.

Maybe MacPorts should come with an uninstall script? How might we  
want that to work? It could uninstall all ports as above, then move  
the remaining parts of itself into a "Previous MacPorts" folder (like  
a Mac OS X Archive & Install puts the parts of the old OS into a  
"Previous Systems" folder).




More information about the macports-dev mailing list