How to Deal with Homebrew 6.0 Asking y/N on Upgrade

How to handle Homebrew 6.0's new interactive upgrade confirmation prompts

* This page contains promotional content

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] y

For 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-name

Registering 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=1

After setting it, restart your shell so that it takes effect, or run the following.

source ~/.zshrc

From 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 upgrade

Alternatively, you can also specify it inline when you run the command.

HOMEBREW_NO_ASK=1 brew upgrade

Summary

SituationWhat to do
You only want to deal with it right nowType y at the prompt
You want to skip it per commandUse the --yes / -y flag
You always want to skip itSet HOMEBREW_NO_ASK=1 in ~/.zshrc
You want to use it inside a scriptexport 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.

See also