Skip to content

Instantly share code, notes, and snippets.

@skluck
Last active April 19, 2023 18:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save skluck/ea6eab4adcbef969ff66c5b5e2926a2f to your computer and use it in GitHub Desktop.
Save skluck/ea6eab4adcbef969ff66c5b5e2926a2f to your computer and use it in GitHub Desktop.
Installing Homebrew in $HOME

1 Ensure xcode is up to date

Download the latest version from the Mac App Store

2 Install Command Line Tools

Either run xcode-select --install or if that fails, manually download them from the Apple Developer Site.

3 (optional) Uninstall Homebrew from /usr/local

Run /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

Download the uninstall script and run ./uninstall --help to view more uninstall options.

4 Download homebrew

Clone https://github.com/homebrew/brew into $HOME/homebrew

5 Add to path in .bashrc

Add homebrew to your $PATH.

Example:

export PATH="$HOME/homebrew/bin:$HOME/homebrew/sbin:$PATH"

6 (optional) Isolated bins

Add a separate bin directory to $PATH if you manually download bins on occasion. For example, composer, nvm, rvm, or go binaries.

export PATH="$HOME/bin:$PATH"

Verification

Run brew doctor and fix any issues it presents. It will always warn about having homebrew outside of /usr/local, that is ok.

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