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)
Instructions for each user - https://docs.brew.sh/Installation#multiple-installations
-
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)
-
If you don't have Command Line Tools installed, you have to run this first:
xcode-select --install
- 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
-
Close the Terminal window
-
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