1. Omid Sayfun
  2. /
  3. Notebook
  • Home
  • About
  • Notebook
  • Token Usage
  • Whisper Usage
Tools
  • Agent Knowledge Base

Running Homebrew on Linux with Multiple Users

May 11, 2026 · Updated on August 09, 2026

A Linuxbrew install belongs to the account that created it. I installed Homebrew on my Linux machine under one user account, then set up a second account and assumed the only remaining step was dropping the shell env line into .bashrc. It wasn't. Sharing one brew install across multiple users takes two fixes, in this order: group permissions on the install tree, then Git safe directory entries.

I write short, practical notes like this one. Get the next one by email:

Unsubscribe anytime.

Problem 1: The Cellar is not writable by the second user

The steps below assume you installed Homebrew on Linux the normal way, at the default prefix /home/linuxbrew/.linuxbrew. The first error is straightforward:

Error: /home/linuxbrew/.linuxbrew/Cellar is not writable.

The fix is to create a shared group, add both users to it, and set group ownership and permissions on the entire Homebrew tree:

# Create a shared group
sudo groupadd linuxbrew
 
# Add both users
sudo usermod -aG linuxbrew user1
sudo usermod -aG linuxbrew user2
 
# Set group ownership and permissions
sudo chgrp -R linuxbrew /home/linuxbrew/.linuxbrew
sudo chmod -R g+rwx /home/linuxbrew/.linuxbrew
 
# Set the setgid bit so new files inherit the group
sudo find /home/linuxbrew/.linuxbrew -type d -exec chmod g+s {} \;
 
# Let the second user traverse the parent directory
sudo chmod 755 /home/linuxbrew

Log out and back in for the group membership to take effect.

Problem 2: Git refuses to run in a repo owned by another user

After fixing permissions, brew update started throwing a different error:

Warning: No remote 'origin' in /home/linuxbrew/.linuxbrew/Homebrew, skipping update!
fatal: detected dubious ownership in repository at '/home/linuxbrew/.linuxbrew/Homebrew'

This is Git's safe-directory check, and it is the same detected dubious ownership in repository error you get on any repo owned by another account. The Homebrew repo is owned by the first user, so Git refuses to operate on it when the second user runs brew. The fix is to mark the Homebrew directories as trusted for the second user:

git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew
git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core
# add any other tap paths that show up in the error

After that, brew update ran cleanly and everything worked as expected.

The short version

To share a Linuxbrew install across accounts: fix group ownership so both users can write to the cellar, then mark the Homebrew Git repos as safe directories for each additional user. Two separate problems, two separate fixes. Neither is complicated once you know what you're looking at.

Join My Newsletter

Occasional notes on software, tools, and things I learn. No spam.

Unsubscribe anytime.

Continue Reading

  • Embeddings rot too. Running pgvector in production.Aug 28, 2026
  • Stop shipping retrieval changes on vibesAug 25, 2026
  • Your RAG is confidently wrong without hybrid searchAug 21, 2026
  • Stop tuning everything. pgvector has three knobs that matter.Aug 18, 2026
  • Your agent's knowledge base is lying to you. Run these 14 checks.Aug 18, 2026