Problems uninstalling MacPorts

3

I am new to mac and OSX, and I installed MacPorts, and a few minutes later I realized that I confused it for another program that I intended to install. Now I have no idea how to uninstall it. I have seen this guide but I don't have a Applications folder. I have looked in Libraries and others, but didn't find the installation folder. At last I ran the command du -h | grep '[Mm]ac[Pp]ort' and got the following output:

268K    ./Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleLion.CoreReference.docset/Contents/Resources/Documents/featuredarticles/UsingMacPorts/Art
316K    ./Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleLion.CoreReference.docset/Contents/Resources/Documents/featuredarticles/UsingMacPorts

Could it be that the installation didn't even finish? I remember having a shinny "V" and the word "Successful" when the installation ended.

I am running Mac OS X Version 10.7.5

Edit

I just checked that all the directories in that guide don't exists, but still I can run the program. This is my console:

$ port -v 
MacPorts 2.1.2
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/username] > quit
Goodbye
$ 

Ramzi Kahil

Posted 2012-12-11T05:18:04.777

Reputation: 667

Do you want to uninstall the whole of MacPorts or a program installed via MacPorts (In which case: see http://apple.stackexchange.com/questions/10149/how-to-remove-unused-macports-packages )

– Hennes – 2012-12-11T05:25:35.730

I what to uninstall the whole MapPorts program. I haven't used it really so no dependencies should exists (unless at installation it added some defaults) – Ramzi Kahil – 2012-12-11T05:59:36.177

Answers

5

You have the correct guide: http://guide.macports.org/chunked/installing.macports.uninstalling.html

The key command to run on that page:

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

If /Applications/MacPorts doesn't exist (don't forget the leading slash; highly unlikely you don't have /Applications at all), and the other directories in that that sudo command line are gone, especially /opt/local, it's uninstalled.

ckhan

Posted 2012-12-11T05:18:04.777

Reputation: 5 689

Please read my edit. – Ramzi Kahil – 2012-12-17T13:40:34.170

@Martin: type which port -- where is it picking up the port binary from? On my system, it's in /opt/local/bin, which shouldn't exist if you've run the command above. – ckhan – 2012-12-17T18:45:45.303

You are right, That fixed it. I probably missed the first.... :) – Ramzi Kahil – 2012-12-17T18:55:05.777