Question

I'm using this link to uninstall macports and instead install homebrew. However, I run into an error on the first step. I run sudo port -f uninstall installed my terminal (I'm on a mac btw) and it spits this right back at me :

Warning: port definitions are more than two weeks old, consider using selfupdate
Warning: configured user/group macports does not exist, will build as root
---> Uninstalling python27 @2.7.1_3
Error: Target org.macports.uninstall returned: error deleting "/opt/local/var/macports/software/python27/2.7.1_3": directory not empty
Log for python27 is at: /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_python27_2.7.1_3/python27/main.log
Warning: Failed to execute portfile from registry for python27 @2.7.1_3 
--->  Uninstalling python27 @2.7.1_3
Error: port uninstall failed: error deleting "/opt/local/var/macports/software/python27/2.7.1_3": directory not empty

I'm not really sure what this stuff means and am not very familiar with macports. I don't even think I installed python with macports...

Was it helpful?

Solution

If you are going to remove macports I would then just do the deletetion

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

The first warnings you are getting are due to not having the latest version of macports so run the selfupdate. For the error you need to look at the log suggested /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_python27_2.7.1_3/python27/main.log

The reason macports installed python without you asking is probably because you asked for a port that needed to use python. Macports will install its own python so that it knows exactly which version and compile options were used for python, as the developers from long experience with unix vendpors have found that the vendors (e.g. Apple) can change things and cause issues (see latest updates to Xcode for a good example) or not provide later bug fixes which are needed. Homebrew trusts Apple and so would use Apple's versions

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top