Hacker News new | ask | show | jobs
by spijdar 2040 days ago
For anyone interested, the problem with homebrew is it relies on "/usr/local" being owned by the current user to allow installing software without needing a password every time you invoke "brew". Naturally this requires you only use that user to invoke homebrew.

Macports does things in a more conventional way, requiring sudo to elevate privileges to root before installing software, but should also work properly on a multi-user system, whereas homebrew sort of assumes a single-user install.

(I think homebrew has some capacity for being used multi-user -- years back my CS professor had a lab of macs and managed to get this working I believe)

4 comments

I don't use a Mac, but couldn't you put both users in the same Unix group, set group-write permissions, and set the setGId bit if it's not the default group of both users (chmod g+w -R /usr/local; find /usr/local -type d -exec chmod g+s '{}' \;) ?
Could you do you something like

alias brew='sudo -u personalaccount brew'

I’ve had good results with the following method: https://gist.github.com/claui/ada85e696029cfa8cba9b91723ce2e...
I know it's not a novel complaint but a really dislike this about homebrew, and I think it should be reason enough to opt for Macports if you need a macOS package manager.

It's just so fragrantly violating the Unix model.