0

On macOS Sierra every time I run brew install Homebrew tries to update itself, and it takes around 10s.

"updating Hombrew

I found this waste of time frustrating, compared to Ubuntu command apt install, which straight installs the required package. Is there any particular reason for this difference? Or any way to at least increase the times before the update. Because by default it is several times a day.

0

1 Answer 1

5

You can set an environment variable to turn this behaviour off. From the man page for brew:

HOMEBREW_NO_AUTO_UPDATE

If set, Homebrew will not auto-update before running brew install, brew upgrade or brew tap.

5
  • 1
    Thank you and sorry for the duplicate I searched but could not find it
    – MCMZL
    Dec 20, 2017 at 15:02
  • 2
    Why does homebrew do this by default, its a huge waste of time? All I wanted was one package, and brew insists on doing a huge upgrade. This has been driving me nuts for years and today I finally had to look up a solution. The worst part is, this typically breaks a few dev repos when I'm not ready to update things like node or other libs. Thanks for this solution! Sep 25, 2021 at 22:06
  • Per response to an issue filed for this very same question: We specifically don't want you to pin Node to a particular version because then you don't get any security updates. We allow you to use e.g. node@6 for ensuring the version is a specific, support Node version. I recommend using a version manager to have all required node versions available on your system and not rely on brew to provide version pinning. A node specific managers is nvm or use asdf to manage versions for pretty much anything. Sep 5, 2022 at 12:53
  • Yeah the brew folks have been pretty , well frankly hostile, to people asking for a way to stop this. They do have some env settings to disable this behavior, but you usually dont even know they exist until its utterly obliterated your dev environment (and I'm not being hyperbolic when I say obliterated, I've lost hundreds of hours in the past cleaning up this mess, its a nuke dropped on your workspace).Homebrew needs to come with a warning . As a python dev, virtualenv usually symlinks to versions. By blowing away that version , it breaks all the symlinks, so all the virtualenvs get killed.
    – Shayne
    Oct 20, 2023 at 7:01
  • You should probably add export HOMEBREW_NO_INSTALL_CLEANUP=1 as well, to stop it automatically deciding that certain packages arent needed anymore
    – Shayne
    Oct 20, 2023 at 7:03

Not the answer you're looking for? Browse other questions tagged .