How to remove ALL ports?

Marc André Selig mas at
Tue Sep 26 07:02:51 PDT 2006

On 26.09.2006, at 12:25, Bengt Nilsson wrote:

>>> My port system seems to be genuinely corrupt on all levels.
>>> Is there any simple way to remove ALL ports, including port  
>>> itself, and do it all over?
>> Unless you've been manually installing things into /opt:
> Yes, I have some other stuff on /opt/local. I thought this was the  
> MacOSX (and Linux?) standard for non-system add-ons, and not  
> dedicated to macports only.
> Whenever I have installed opensource I have directed it to /opt/ 
> local rather than /usr/local.

I don't know much about Mac OS X file system standards, but it  
certainly makes things easier to have a separate hierarchy dedicated  
to ports based installations, no matter what the standard says. :)

That said, if your port system is at least somewhat working, you  
should still be able to find out which files were installed from  

for i in `port installed | awk 'NR>1 {print $1}'`; do port contents  
$i | awk 'NR>1 {print $0}'; done

This will not cover the files used by MacPorts itself, only those  
installed by it.  To get an idea of what files are created by the  
ports system itself, you might want to move /opt out of the way for a  
minute, then install MacPorts, do a selfupdate, install a sample  
port, then have a look at the newly created /opt hierarchy.

I'm afraid that cutting something out of a directory tree is always a  
hassle.  That's why we use MacPorts. ;)


More information about the macports-users mailing list