Skip to content

Instantly share code, notes, and snippets.

@heavensloop
Created April 22, 2024 13:36
Show Gist options
  • Save heavensloop/821eb7c84f3cd478d1d87b92cf06f686 to your computer and use it in GitHub Desktop.
Save heavensloop/821eb7c84f3cd478d1d87b92cf06f686 to your computer and use it in GitHub Desktop.
Setup brew on multi-user account

Setup multi user

Method one - Use one brew installation for all accounts (buggy)

echo $(brew --prefix)
echo $(groups $(whoami))
sudo dseditgroup -o edit -a $(whoami) -t user admin
sudo chgrp -R admin $(brew --prefix) 
sudo chmod -R g+rwX $(brew --prefix)
ls -lah $(brew --prefix)

Method two - Separate installations in the home directory of each account

Instructions for each user - https://docs.brew.sh/Installation#multiple-installations

  1. If you currently have brew installed on your system globally, I recommend uninstalling brew first. (You can see where brew is installed running which brew)

  2. If you don't have Command Line Tools installed, you have to run this first:

xcode-select --install

  1. Open terminal and Run:

MacOS Catalina 10.15 or newer: cd $HOME

mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
echo 'export PATH="$HOME/homebrew/bin:$PATH"' >> .zprofile
  1. Close the Terminal window

  2. Open Terminal again, and run this to ensure your installation is correct:

brew doctor Done!

From - https://stackoverflow.com/questions/11038028/what-is-the-best-safest-way-to-reinstall-homebrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment