Skip to content

Instantly share code, notes, and snippets.

@lojikil
Created July 31, 2016 13:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lojikil/0bb81da8713432f19f3f55e6fbef6797 to your computer and use it in GitHub Desktop.
Save lojikil/0bb81da8713432f19f3f55e6fbef6797 to your computer and use it in GitHub Desktop.
backup copy of a single-user `brew` installation
# change to whatever location to where homebrew is installed
if [ -z "$HOMEBREW_HOME" ]; then
export HOMEBREW_HOME=$HOME/homebrew
echo "HOMEBREW_HOME=$HOME/homebrew" >> ~/.profile
fi
# install homebrew for single user
if [ ! -d "$HOMEBREW_HOME" ]; then
mkdir -p $HOMEBREW_HOME && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $HOMEBREW_HOME
fi
# add the new homebrew bin directory to the path
if [ -z `echo $PATH | grep "$HOMEBREW_HOME"` ]; then
echo "PATH=$HOMEBREW_HOME/bin:$PATH" >> ~/.profile
export PATH=$HOMEBREW_HOME/bin:$PATH
fi
# configure the local homebrew cache directory
if [ -z "$HOMEBREW_CACHE" ]; then
echo "HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew" >> ~/.profile
export HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew
fi
@lojikil
Copy link
Author

lojikil commented Aug 6, 2018

If you see the following:

Updating Homebrew...
Error: Could not link:
/Users/GoodPersonUser/homebrew/share/doc/homebrew

Please delete these paths and run `brew update`.
...

you can safely delete ~/homebrew/share/doc/homebrew; I dunno when this happened, but it only happens with new installs (and thus I've not had a chance to test it, as I only end up with a new mac every few years. I probably should figure out where in the install process I can delete that, but for now, it's safe to delete that path if you see it.

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