omiid
homenotebookai usage

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
  • Tuning Postgres and pgvector: the three knobs that matter08-18-2026 · Most pgvector performance problems come down to three settings. This post shows how to read an ANN query plan and tune ef_search, shared_buffers, and work_mem in the right order.
  • AI text watermarking: how it works and what it can't do08-16-2026 · Claude now watermarks its text. The watermark changes where the randomness in word choice comes from, not what the model can say. Here is the whole pipeline, with simulations you can poke at.
  • HNSW vs IVFFlat: choosing and building your pgvector index08-14-2026 · Past a few hundred thousand rows, an exact scan stops being fast enough. Here is how to pick between HNSW and IVFFlat and build the index without locking the table.
  • Vector search relevance: chunking, metadata, and the 0.81 problem08-11-2026 · Most bad vector search results come from one of three failure modes: chunking, modality mismatch, or a confused model. Each one has a specific diagnostic and a specific fix.
  • pgvector setup: your first multimodal query in TypeScript08-03-2026 · One Postgres table can hold text and screenshot embeddings in the same vector column. This post sets up the schema, the Voyage embedding call, and the first query that returns both.