I have MacPorts installed on my iMac with a fair number of ports installed.

I'm interested in trying out Homebrew, though, as I've heard many good things about it, and because I've noticed that it contains more up-to-date versions of several of the tools that I use.

But can the two coexist on the same machine, or do I need to uninstall MacPorts entirely first?

Also, if the two can be installed at the same time, will they be completely independent of each other? One of the features of Homebrew is that is doesn't reinstall new versions of things which are already included in the system (e.g. python). Does this also extend to it not installing versions of things which are already maintained by MacPorts?

What happens if I then subsequently uninstall MacPorts?

link|improve this question

feedback

3 Answers

up vote 4 down vote accepted

They will not coexist well together. The Apple gcc looks in /usr/local for some things. This means that a macports compile could find something the porter did not expect. See macports mail lists and bugs for examples of things found in /usr/local.

link|improve this answer
3  
I've only had a very cursory look at homebrew, but if you changed the default install location for homebrew from /usr/local to something like /opt/homebrew/usr/local, would that problem be avoided? – Babu Sep 12 '10 at 20:27
feedback

Worries about what the Gnu build tools will make of /usr/local are verging on paranoid. The build tools expect there to be lots of things there: in the good old days before package managers, we compiled whatever to /usr/local.

The risk of trouble with Autoconf finding something it shouldn't under /usr/local needs to be balanced about the maintenance nuisance having two, three, or four different different copies of Perl, Tcl, and Ruby, each with different coverage of their different package libraries.

Since my experience with MacPorts and Fink has typically been exasperation caused by exactly this, and at some point switching to compiling the old-fashioned way to /usr/local, I was pleased to see that Homebrew didn't mess about with that. I tried configuring MacPorts to install to /usr/local, but MacPorts goes out of its way to make that difficult. I understand that the motivation is to make life easier for themselves when dealing with cries for help on their mailing list and bug tracker. I wonder how long Homebrew will last.

So I'll say, yes, it's safe, provided you are willing to bear some risk, and are willing to figure out things a bit yourself if things go wrong. Homebrew, in this respect at least, does things the way they are supposed to be done, and MacPorts tries not to interfere.

link|improve this answer
Well, my question is asked from the perspective of a dumb user that is just using the package manager to "get stuff". It's not at all certain that I would be able "to figure out things a bit [my]self if things go wrong." Still, upvote anyway for the extra clarification. Thanks! – Rich Nov 26 '10 at 13:52
1  
MacPorts as good reasons not to use /usr/local, see trac.macports.org/wiki/FAQ#defaultprefix – Raim Feb 18 '11 at 20:07
2  
@Raim: Good reasons for them - it is pretty much a trade off between their bug-tracking convenience and the simplicity of the install on the user's machine. I care about the latter. – Charles Stewart Feb 18 '11 at 21:12
feedback

I gave another answer on a similar question:

Homebrew will cause problems when building software from source if it is installed in /usr/local. This is the default, which is a bad choice as this path is in the default search path of compilers and other tools. Therefore builds from other packaging software might pick up the wrong dependency, using Homebrew's version instead of their own.

Years ago, in the very beginning of the project, even MacPorts was using /usr/local. But it turned out not to cooperate with other tools as is documented in their FAQ. Unfortunately Homebrew developers didn't want to hear about prior experiences and ignored such facts...

In general, it is usually better to stick to one tool only to avoid all problems. MacPorts is doing their best to patch out any harcoded paths, e.g. to /sw which is used by Fink. So usually it will work, but having anything installed in /usr/local will definitely cause problems for it.

[…]

link|improve this answer
Looks like it is also possible to install homebrew in ~/.homebrew. Would it still interfere with MacPorts if it is installed there instead? – Behrang Mar 24 at 3:14
Any other location than /usr/local should be okay. – Raim Mar 25 at 11:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.