Hacker News new | ask | show | jobs
by alanbernstein 2040 days ago
I decided to try this when I got a new Macbook recently. There are a few hiccups: - Firefox simply does not work in macos after switching accounts. This seems like a completely unacceptable bug, but it has apparently existed for years. - home brew does not seem to expect to be used by two users, so I've had to switch into my personal account to use it. - configuring my os, shell, browser, etc now requires doing everything twice.

So it's not a perfect solution, but overall it's worth the effort.

2 comments

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)

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.

It's possible to configure Homebrew to only install stuff in your home folder. But you do need a "manual" installation to achieve it. I have done it.