3 ms·
Why does brew need to install everything owned by my user in /usr/local? I would honestly prefer if everything installed by brew was owned by root:wheel and bre
by skrause 11y ago
Why does brew need to install everything owned by my user in /usr/local? I would honestly prefer if everything installed by brew was owned by root:wheel and brew would gracefully abort if I forgot to run it with sudo.
Is all that current mess just so that I don't need sudo for brew?
- pilif 11y agoThen install brew with sudo.
- skrause 11y agoThis is what you used to see when you tried to use sudo with brew: Error: Cowardly refusing to `sudo brew install` You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk. I don't know if it's different now, but a quick Google search indicates that brew still behaves like this. I would like to use brew with sudo, but I don't want to use unsupported methods.
- mseri 11y agoYou can create an admin account and use that ad indirection for dealing With homebrew
- gutnor 11y agoYes it is still like this. When XCode needed some license approval after the recent upgrade to support iOS9, Brew warned me that license can only be approved ( programatically ) by root. I tried to sudo brew and received the warning you showed. That was 1 week ago.
- provemewrong 11y ago>so do so at your own risk. sudo su at your own risk, hehe.
- fit2rule 11y agoWhat is /usr/local for, if its not for locally installed (by the user) sub-components? Just curious whats wrong with using /usr/local. This is what its for, after all ..
- skrause 11y agoUsing /usr/local is just fine. But I feel uneasy when a system directory is owned by just my user. What if there is another user on my system that also wants to perform a brew update? Using sudo would also be a security advantage since not every program running under your username would be able to modify all binaries in /usr/local.
- potatosareok 11y ago/usr/local makes sense to me if you've installed brew with sudo. But as other comment says, it's weird to me to have files owned by login user in system directory. It's such a rare scenario now I guess of multiple people on same machine, but isn't user home directory place for files owned by login user?
- __d 11y agoTypically /usr/local relies on group permissions: the accounts that you trust to build and install stuff are added to, eg. 'admin' group, and /usr/local is group writable for admin with the group s-bit set.
- lsaferite 11y ago/usr/local is for machine local packages vs. packages that are meant to be shared across multiple machines. /usr/local is still under the control of the local sysadmin though and not a user. http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHI... Really brew should always be installing somewhere under ~/ if you are installing packages as a user.
- coldtea 11y agoSo you'd want all those programs to run as root? Isn't that against any notion of security?
- icebraining 11y agoWhy would they run as root, just because they were owned by root? Only brew itself would need to run as root (just like most package managers do anyway).
- coldtea 11y ago>Why would they run as root, just because they were owned by root? Because "sudo" (that OP wants to run them with) runs them as root by default?
- icebraining 11y agoOP wants to run it (ie, brew) with sudo, not them.