Allow non-admin users to use homebrew

(Jurgen Landrie) #1

I’ve been reading a lot about this and tried several options, but nothing really suited my needs.
My situation is as follows:
I’m running OS Sierra on iMac.
I have an account “master” who is administrator.
I have an account “jurgan” who is regular user.
What I’m trying to achieve is for jurgan to be able to install homebrew packages, as well as cask packages.

It seems like the only way I can achieve this is to install homebrew in a directory under my home directory, but when doing so, I get the warning that some packages my fail because they need to be in /user/local.

What would you folks suggest I do to achieve (something as close as possible to) what I described above?

Note: making jurgan administrator, installing homebrew and making him regular user again tries to move apps to /Applications, for which it has no permissions obviously. I thought they’d go in ~/Applications, but it seems I was wrong :frowning:

Any suggestions would be greatly appreciated!
Thanks a lot in advance.

(Mike McQuaid) #2

We’d recommend using Homebrew as an administrator and installing into /usr/local.

(Jurgen Landrie) #3

OK thanks. I’ll make jurgan administrator then.
It would be nice though if this could be implemented in some future :wink:
Other than that, very satisfied with Homebrew and keep up the good work!

(dragon788) #4

You should also check out ‘brewdo’. It’s a fantastic package that sets up sudo for running brew commands only rather than using root to do the installs which can sometimes have negative side effects.

(Mike McQuaid) #5

brewdo is unsupported and Homebrew does not use a root user to do installs.

(Eric) #6

Speaking as someone who has an admin user and a standard user (recommended for security by many sources); being able to run Homebrew as a standard user would be very helpful for a couple of small edge cases. Normally I su to my admin account and work from there to update/upgrade/install, but things like for example don’t work at all - they install to my admin user’s home directory, which is fscking useless.

Is this a homebrew issue? is this a cask issue? is this a bad plugins issue? No matter what, I’m frustrated by the need to do manual installs. It would be great to see Homebrew support this use case.

(Joshua McKinney) #7

@Aktariel, Try setting --qlplugindir= default is ~/Library/QuickLook. See man brew-cask for more info. Given these install by default to your user directory, perhaps you could alternatively just run brew cask as your standard user.