From Homebrew 6.0 onwards, running brew upgrade or brew install asks you to confirm whether to continue.
==> This action will upgrade X formulae.
Proceed? [y/N]Until now it went ahead automatically, so I imagine many people were caught off guard. In this article I summarize the ways to deal with it depending on the situation.
Dealing with it on the spot
If you do not need to change any settings in particular, all you do is type y and press Enter when the prompt appears.
Proceed? [y/N] yFor a one-off operation, this is the simplest approach.
Adding the --yes flag to the command
If you want to skip the confirmation every time, add the --yes (or -y) flag to the command.
brew upgrade --yes
brew install --yes package-nameRegistering it as an alias is handy.
# Add to ~/.zshrc
alias bup='brew upgrade --yes'Disabling it permanently (environment variable)
If you want to disable the confirmation prompt completely, set the environment variable HOMEBREW_NO_ASK=1.
# Add to ~/.zshrc
export HOMEBREW_NO_ASK=1After setting it, restart your shell so that it takes effect, or run the following.
source ~/.zshrcFrom then on, every brew command runs without a confirmation.
Automating it inside scripts
If you use brew in CI/CD or inside a shell script, you can handle it the same way by setting HOMEBREW_NO_ASK=1.
#!/bin/bash
export HOMEBREW_NO_ASK=1
brew update
brew upgradeAlternatively, you can also specify it inline when you run the command.
HOMEBREW_NO_ASK=1 brew upgradeSummary
| Situation | What to do |
|---|---|
| You only want to deal with it right now | Type y at the prompt |
| You want to skip it per command | Use the --yes / -y flag |
| You always want to skip it | Set HOMEBREW_NO_ASK=1 in ~/.zshrc |
| You want to use it inside a script | export HOMEBREW_NO_ASK=1 inside the script |
This change in Homebrew 6.0 was introduced as a safety measure to prevent accidental upgrades. Choose the approach that suits your use.