Fixing Homebrew

Boy does my Homebrew installation like to get messed up. Pretty much every time I do a big brew update I have to repair everything. This is what I typically have to do:

cd /usr/local
sudo chown -R USERNAME /usr/local/.git
sudo chown -R USERNAME /usr/local
sudo chown -RL mysql:mysql /usr/local/mysql/data
git pull
git reset --hard origin/master
brew update

My permissions often end up completely out of whack, and I also get a bunch of garbage in the /usr/local directory. This fixes the permissions and pulls the latest from homebrew and runs the update. Your mileage may vary.

Thomas Hunter II Avatar

Thomas is the author of Advanced Microservices and is a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.