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.

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.t
....

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.2.3/iproute2mac-1.2.3.tar.gz
Already downloaded: /Users/jkmutai/Library/Caches/Homebrew/downloads/fdb133eaa8f1346a259295ba9aa22ab568e0dd6b6506cafab6891ae6e31fcf84--iproute2mac-1.2.3.tar.gz🍺  /usr/local/Cellar/iproute2mac/1.2.3: 6 files, 22.5KB, built in 2 seconds

We can confirm no update was attempted.

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here