Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since MacPorts is not compatible with /usr/local *, whenever I install/update ports with MacPorts I would

sudo mv /usr/local /usr/local.bak

and after I am done building MacPorts stuff

sudo mv /usr/local.bak /usr/local

This works and solves a lot of the previous mysterious build errors. However it is very cumbersome and sometimes I don't remember to do this, either the "before" step or the "after" step, and have to fix it afterward.

Is there a better way to avoid this conflict?

EDIT * see these links for examples/suggestions of temporarily moving /usr/local as a solution to MacPort build problems.

http://stackoverflow.com/questions/1827377/install-git-core-svn-fails-with-macport

https://trac.macports.org/ticket/21649

https://trac.macports.org/ticket/29998

share|improve this question

I don't understand what /usr/local conflicts you're talking about. MacPorts intentionally uses its own /opt hierarchy in order to avoid conflicting with anything you already had in /usr/local. It shouldn't be putting anything in /usr/local unless perhaps you changed its configuration.

Were you thinking of Homebrew? I believe Homebrew still puts things in /usr/local by default, whereas MacPorts uses /opt and Fink uses /sw.

So I guess my "better way to avoid this conflict" is to use MacPorts instead of Homebrew, and leave MacPorts set to its default prefix of /opt.

share|improve this answer
    
I am using MacPorts; and I don't have Homebrew. Please see the edit for why I am doing this. I am curious why you don't have this issue though. I have checked my path and it points to /opt/local/bin:/opt/local/sbin:/opt/subversion/bin: before anything from /usr/local. But this is still an issue. – ceiling cat Aug 31 '11 at 8:12
1  
MacPorts cannot isolate itself away from /usr/local, as this path is in the default search path of the compiler and cannot be removed. – Raim Sep 23 '11 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .