Homebrew installation on OSX without changing /usr/local/* owner


(Fabio Frumento) #1

Is that possible ? I think it’s insane to have a tool change /usr/local/bin ownership to current user


(Mike McQuaid) #2

Yes but it’s unsupported and you won’t receive most binary packages.

https://github.com/Homebrew/brew/blob/master/docs/FAQ.md#why-does-homebrew-prefer-i-install-to-usrlocal explains why. It’s not insane and it doesn’t need to be your current user if you don’t wish (although we recommend it); just the non-root user you use to run Homebrew.


(Fabio Frumento) #3

HI Mike,

Thank you very much for the promptly reply, I’ve read the whole story, still not fully convinced about “Apple has left this directory for us …omissis…” anyway that’s the way it works I’ll spend some time to understand the impact on other tools I had to install un /usr/local (gcc cross compile toolchain one for all) before to take the final step.

Thanks a lot and regards !

Fabio


(Maxubuntu) #4

Since /usr/local/ belongs to group wheel, my solution is to add myself as a member of wheel:

$ sudo dscl . append /Groups/wheel GroupMembership ${USER}

then grant group writable permission to those target directories:

$ sudo chmod g+w /usr/local/{etc,bin,sbin,share,share/doc}

I believe this can solve permission issue while doing brew install.