How To

How To Disable Homebrew Auto update on macOS

Homebrew is a free and open-source package management system for macOS users. It gives you a flexible way to install the UNIX tools Apple doesn’t include on macOS. The package management covers installation, searching, updating, cleanup and complete uninstallation. If you’re a frequent user of brew command line tool you must have noted that it performs update every time a command to install formula is executed.

Original content from computingforgeeks.com - post 61164

See the example below to install ranger formula:

$ brew install ranger
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Casks
browserosaurus

==> Downloading https://ranger.github.io/ranger-/1.9.3_2-1
....

To prevent this update whenever you run a brew command, pass 1 to the HOMEBREW_NO_AUTO_UPDATE environment variable.

HOMEBREW_NO_AUTO_UPDATE=1 brew install <formula>

This is a one time operation. To make it a permanent configuration set the variable in your .bashrc or .zshrc file depending on the shell you use.

### Bash ###
$ vim ~/.bashrc
export HOMEBREW_NO_AUTO_UPDATE=1

### Zsh ###
$ vim ~/.zshrc
export HOMEBREW_NO_AUTO_UPDATE=1

Source the shell configuration file:

source ~/.bashrc
#OR
source ~/.zshrc

Now try and installation of formula to confirm the setting was effective.

$ brew install iproute2mac
==> Downloading https://github.com/brona/iproute2mac/releases/download/v1.4.0/iproute2mac-1.4.0.tar.gz
Already downloaded: /Users/jkmutai/Library/Caches/Homebrew/downloads/fdb133eaa8f1346a259295ba9aa22ab568e0dd6b6506cafab6891ae6e31fcf84--iproute2mac-1.4.0.tar.gz🍺  /usr/local/Cellar/iproute2mac/1.4.0: 6 files, 22.5KB, built in 2 seconds

We can confirm no update was attempted.

Related Articles

Tips & Tricks How to reset Windows 10 from factory on your PC [best way] Tips & Tricks How to Convert Image to Text in Microsoft Word Online Tips & Tricks Best Practices for Merging PDFs with Different Page Sizes and Orientations Programming How To Customize Bash on Linux with Bash-it

1 thought on “How To Disable Homebrew Auto update on macOS”

Leave a Comment

Press ESC to close