Skip to content

Instantly share code, notes, and snippets.

@riteshgurung
Forked from skluck/instructions.md
Last active January 13, 2023 02:24
Show Gist options
  • Save riteshgurung/e0cdfe81648181847048a9ad2ceb31ca to your computer and use it in GitHub Desktop.
Save riteshgurung/e0cdfe81648181847048a9ad2ceb31ca 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 or .zshrc

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