Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SilverEzhik/8f421ecbc5cc2b3fec58e9f36b7e50b0 to your computer and use it in GitHub Desktop.
Save SilverEzhik/8f421ecbc5cc2b3fec58e9f36b7e50b0 to your computer and use it in GitHub Desktop.
Disable Homebrew auto-update every time you run it

Homebrew does something annoying and does its long update process almost every time you run it, which is irritating.

Here's a way to fix it while still keeping auto-updating on.

Add this to your .bashrc or equivalent:

HOMEBREW_NO_AUTO_UPDATE=1

Then, to keep your Homebrew updated, add this one-liner to your crontab (crontab -e):

@hourly if [ "`pmset -g batt | grep 'AC Power'`" != '' ]; then brew update > /dev/null 2> /dev/null; fi

This will run brew update hourly, but only if you're connected to AC power.

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