Skip to content

Instantly share code, notes, and snippets.

@romancin
Created February 26, 2020 07:04
Show Gist options
  • Save romancin/519e483862c1b9db36ad95ce4cf9bc84 to your computer and use it in GitHub Desktop.
Save romancin/519e483862c1b9db36ad95ce4cf9bc84 to your computer and use it in GitHub Desktop.

Completed and updated for Catalina (macOS 10.15)

Homebrew multi-user setup

Homebrew Multi User Setup

First, create a brew group and add users

Do this once

  1. sudo dseditgroup -o create brew Create a brew group
  2. sudo dseditgroup -o edit -a USER1 -t user brew Add first user
  3. sudo dseditgroup -o edit -a USER2 -t user brew Add second user

Then, change the installation directories

This might need to be repeated on occasion

  1. brew doctor Check to see how wrong things are
  2. sudo chgrp -R brew $(brew --prefix)/* Change the group of homebrew installation directory
  3. sudo chmod -R g+w $(brew --prefix)/* Allow group members to write inside this directory
  4. brew doctor Check to see how correct things are

Node.js Upgrade Permissions Error

If the error below appears when running brew upgrade, change the ownership and permissions with the commands further down

Error: Permission denied @ rb_sysopen - /usr/local/var/homebrew/locks/[email protected]

  1. sudo chgrp -R brew /usr/local/var/homebrew/*
  2. sudo chmod -R g+w /usr/local/var/homebrew/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment