Enable multiple users to install software using homebrew











up vote
12
down vote

favorite
6












I installed homebrew using my other user account (which I use during work), but it is impossible to install software from my newly created personal account:



$ brew install unrar
Error: Cannot write to /usr/local/Cellar


A ls -dl /usr/local/Cellar/ shows that the directory is owned by my other user account.



How do I configure homebrew to allow multiple users to install software?










share|improve this question






















  • You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
    – Nathan Lloyd
    Aug 20 at 22:14















up vote
12
down vote

favorite
6












I installed homebrew using my other user account (which I use during work), but it is impossible to install software from my newly created personal account:



$ brew install unrar
Error: Cannot write to /usr/local/Cellar


A ls -dl /usr/local/Cellar/ shows that the directory is owned by my other user account.



How do I configure homebrew to allow multiple users to install software?










share|improve this question






















  • You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
    – Nathan Lloyd
    Aug 20 at 22:14













up vote
12
down vote

favorite
6









up vote
12
down vote

favorite
6






6





I installed homebrew using my other user account (which I use during work), but it is impossible to install software from my newly created personal account:



$ brew install unrar
Error: Cannot write to /usr/local/Cellar


A ls -dl /usr/local/Cellar/ shows that the directory is owned by my other user account.



How do I configure homebrew to allow multiple users to install software?










share|improve this question













I installed homebrew using my other user account (which I use during work), but it is impossible to install software from my newly created personal account:



$ brew install unrar
Error: Cannot write to /usr/local/Cellar


A ls -dl /usr/local/Cellar/ shows that the directory is owned by my other user account.



How do I configure homebrew to allow multiple users to install software?







mac user-accounts homebrew






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 14 '11 at 0:59









Sridhar Ratnakumar

2,05683352




2,05683352












  • You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
    – Nathan Lloyd
    Aug 20 at 22:14


















  • You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
    – Nathan Lloyd
    Aug 20 at 22:14
















You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
– Nathan Lloyd
Aug 20 at 22:14




You can take control from the other user by doing sudo chown -R $(whoami) /usr/local
– Nathan Lloyd
Aug 20 at 22:14










3 Answers
3






active

oldest

votes

















up vote
13
down vote













set umaskfor each user first. (.basrc or .profile or .bash_profile)



umask 0002 # group write permission


then give write permission for groups via /usr/local recursively:



sudo chmod -R g+w /usr/local/


then change the owner to staff



sudo chgrp -R staff /usr/local


now, each user, who is in staff group can use brew install and other brew related operations... Mostly every user is in that group.






share|improve this answer



















  • 1




    I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
    – Duvrai
    Dec 16 '14 at 16:50




















up vote
1
down vote













On the homebrew wiki, it mentions that you can install it anywere, try having local installations for each user.






share|improve this answer





















  • I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
    – Sridhar Ratnakumar
    Jun 22 '11 at 3:36










  • I've tried this and wish I hadn't as you get messed up user permissions
    – MatthewFord
    Jul 12 '11 at 11:36


















up vote
0
down vote



accepted










Here's my workaround:



su - myother_user_account -c "brew install ..."





share|improve this answer

















  • 1




    This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
    – Caleb
    Sep 18 '15 at 9:46











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f283254%2fenable-multiple-users-to-install-software-using-homebrew%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
13
down vote













set umaskfor each user first. (.basrc or .profile or .bash_profile)



umask 0002 # group write permission


then give write permission for groups via /usr/local recursively:



sudo chmod -R g+w /usr/local/


then change the owner to staff



sudo chgrp -R staff /usr/local


now, each user, who is in staff group can use brew install and other brew related operations... Mostly every user is in that group.






share|improve this answer



















  • 1




    I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
    – Duvrai
    Dec 16 '14 at 16:50

















up vote
13
down vote













set umaskfor each user first. (.basrc or .profile or .bash_profile)



umask 0002 # group write permission


then give write permission for groups via /usr/local recursively:



sudo chmod -R g+w /usr/local/


then change the owner to staff



sudo chgrp -R staff /usr/local


now, each user, who is in staff group can use brew install and other brew related operations... Mostly every user is in that group.






share|improve this answer



















  • 1




    I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
    – Duvrai
    Dec 16 '14 at 16:50















up vote
13
down vote










up vote
13
down vote









set umaskfor each user first. (.basrc or .profile or .bash_profile)



umask 0002 # group write permission


then give write permission for groups via /usr/local recursively:



sudo chmod -R g+w /usr/local/


then change the owner to staff



sudo chgrp -R staff /usr/local


now, each user, who is in staff group can use brew install and other brew related operations... Mostly every user is in that group.






share|improve this answer














set umaskfor each user first. (.basrc or .profile or .bash_profile)



umask 0002 # group write permission


then give write permission for groups via /usr/local recursively:



sudo chmod -R g+w /usr/local/


then change the owner to staff



sudo chgrp -R staff /usr/local


now, each user, who is in staff group can use brew install and other brew related operations... Mostly every user is in that group.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 29 at 5:28

























answered Jan 17 '12 at 12:05









vigo

18126




18126








  • 1




    I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
    – Duvrai
    Dec 16 '14 at 16:50
















  • 1




    I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
    – Duvrai
    Dec 16 '14 at 16:50










1




1




I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
– Duvrai
Dec 16 '14 at 16:50






I had to do the same for /Library/Caches/Homebrew to make this actually work. And since all my users have Administrator Access enabled I skipped the chgrp
– Duvrai
Dec 16 '14 at 16:50














up vote
1
down vote













On the homebrew wiki, it mentions that you can install it anywere, try having local installations for each user.






share|improve this answer





















  • I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
    – Sridhar Ratnakumar
    Jun 22 '11 at 3:36










  • I've tried this and wish I hadn't as you get messed up user permissions
    – MatthewFord
    Jul 12 '11 at 11:36















up vote
1
down vote













On the homebrew wiki, it mentions that you can install it anywere, try having local installations for each user.






share|improve this answer





















  • I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
    – Sridhar Ratnakumar
    Jun 22 '11 at 3:36










  • I've tried this and wish I hadn't as you get messed up user permissions
    – MatthewFord
    Jul 12 '11 at 11:36













up vote
1
down vote










up vote
1
down vote









On the homebrew wiki, it mentions that you can install it anywere, try having local installations for each user.






share|improve this answer












On the homebrew wiki, it mentions that you can install it anywere, try having local installations for each user.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 18 '11 at 21:56









MatthewFord

1313




1313












  • I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
    – Sridhar Ratnakumar
    Jun 22 '11 at 3:36










  • I've tried this and wish I hadn't as you get messed up user permissions
    – MatthewFord
    Jul 12 '11 at 11:36


















  • I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
    – Sridhar Ratnakumar
    Jun 22 '11 at 3:36










  • I've tried this and wish I hadn't as you get messed up user permissions
    – MatthewFord
    Jul 12 '11 at 11:36
















I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
– Sridhar Ratnakumar
Jun 22 '11 at 3:36




I don't want that, actually. I want the software to go to a common place irrespective of who installed it.
– Sridhar Ratnakumar
Jun 22 '11 at 3:36












I've tried this and wish I hadn't as you get messed up user permissions
– MatthewFord
Jul 12 '11 at 11:36




I've tried this and wish I hadn't as you get messed up user permissions
– MatthewFord
Jul 12 '11 at 11:36










up vote
0
down vote



accepted










Here's my workaround:



su - myother_user_account -c "brew install ..."





share|improve this answer

















  • 1




    This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
    – Caleb
    Sep 18 '15 at 9:46















up vote
0
down vote



accepted










Here's my workaround:



su - myother_user_account -c "brew install ..."





share|improve this answer

















  • 1




    This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
    – Caleb
    Sep 18 '15 at 9:46













up vote
0
down vote



accepted







up vote
0
down vote



accepted






Here's my workaround:



su - myother_user_account -c "brew install ..."





share|improve this answer












Here's my workaround:



su - myother_user_account -c "brew install ..."






share|improve this answer












share|improve this answer



share|improve this answer










answered May 23 '11 at 4:05









Sridhar Ratnakumar

2,05683352




2,05683352








  • 1




    This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
    – Caleb
    Sep 18 '15 at 9:46














  • 1




    This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
    – Caleb
    Sep 18 '15 at 9:46








1




1




This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
– Caleb
Sep 18 '15 at 9:46




This is not a recommended solution to the multiple-users problem. It requires users to be able to have root access and/or direct access to run commands as another user which kind of defeats the purpose of having user level privileges in the first place. You can break the model for your own use case given you own the box and both accounts, but it would be ill advised for anybody else to use this and your own system usage would be safer for using proper privilege separations.
– Caleb
Sep 18 '15 at 9:46


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f283254%2fenable-multiple-users-to-install-software-using-homebrew%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix