No.. Unless you do significant surgery.
The reason is that Homebrew strongly insists on installing packages into /usr/local
. In fact, even if you forced it to install somewhere else, you are likely to break dependencies when you use brew install
to install packages. Most if not all of these packages are pre-compiled and linked expecting to live in /usr/local
.
The reason for this insistence is that /usr/local
is precisely where POSIX recommends that stuff like this gets installed. In order to create /usr/local
Homebrew needs temporary admin credentials to create the directory and assign ownership.
This, in turn, is what allows you to install anything else without elevating credentials.
3This is just wrong, or at least you definition of "significant surgery" is very different then mine. I've been running
brew
with a prefix set to my home directory for 5 plus years and I've encounter 1 or 2 broken packages in that time. – James McMahon – 2017-09-12T02:22:39.613However, also there is also this, which is hard to get around: Error: You have not agreed to the Xcode license. Please resolve this by running: sudo xcodebuild -license accept – Albert – 2019-01-16T17:47:12.630
Thanks, but I think you missed my question. I know how & where it installs packages, but I want to install Homebrew without admin or sudo. – BenjaminGolder – 2013-07-14T01:17:11.847
I didn't miss your question. The answer was "No".. I just said "Yes" accidentally. You cannot easily do what you are asking and even if you forced it by editing the Homebrew installer to put things into a branch off of your home directory, more than likely lots of brews would fail after installation. – David Hoelzer – 2013-07-14T01:18:38.727
okay, thanks. I was confused by the previous "Yes". – BenjaminGolder – 2013-07-14T01:25:19.753