Homebrew brew install hangs on macOS executors ("Do you want to proceed with the installation?")

If a macOS job on CircleCI hangs during a brew install step and eventually fails with Too long with no output (exceeded 10m0s), check the step output for this Homebrew prompt:

Do you want to proceed with the installation? [y/n]

CircleCI jobs run without an interactive terminal. When Homebrew waits for input, the step produces no further output and hits the default 10-minute no-output timeout.

Homebrew is pre-installed on CircleCI macOS executors. You normally run brew install directly. You do not need to install Homebrew itself unless you are on a custom image.

Symptoms

  • A step runs brew install.
  • The log lists formulas and dependencies, then stops at [y/n].
  • The step ends with Too long with no output (exceeded 10m0s) or context deadline exceeded.
  • Later steps may fail if they depend on packages that were not installed.

Cause

Recent Homebrew versions use ask mode by default for some install operations. When a formula pulls in dependencies, Homebrew may ask for confirmation before proceeding. That prompt works locally in a terminal but blocks in CI.

This is separate from slow brew update behavior. Setting HOMEBREW_NO_AUTO_UPDATE: 1 skips automatic updates. It does not skip install confirmation prompts.

NONINTERACTIVE=1 does not fix brew install

Homebrew documents NONINTERACTIVE=1 for the Homebrew installer script only (unattended installation):

NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

That variable applies when installing the brew command itself. It does not apply to routine package installs such as:

brew install <package>

If you set NONINTERACTIVE=1 in a job or context expecting it to silence brew install, the step can still hang on the confirmation prompt.

Resolution

Use one of the following for brew install (and similar commands) on macOS jobs.

Option 1: HOMEBREW_NO_ASK=1 (recommended)

Set the environment variable on the step or at job level:

jobs:
  build:
    macos:
      xcode: <your-xcode-version>
    environment:
      HOMEBREW_NO_AUTO_UPDATE: 1
      HOMEBREW_NO_ASK: 1
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: brew install <package>

Or export it in the step:

- run:
    name: Install dependencies
    command: |
      export HOMEBREW_NO_ASK=1
      brew install <package>

Option 2: brew install -y / --no-ask

- run:
    name: Install dependencies
    command: brew install -y <package>

Option 3: Pipe yes

- run:
    name: Install dependencies
    command: yes | brew install <package>

This works but is less explicit than HOMEBREW_NO_ASK=1 or -y.

Environment variables at a glance

Variable / flag Applies to Skips install confirmation? Notes
NONINTERACTIVE=1 Homebrew install.sh only No (not for brew install) Installer script only
HOMEBREW_NO_AUTO_UPDATE=1 brew install, brew upgrade, etc. No Skips auto-update only
HOMEBREW_NO_ASK=1 brew install, brew upgrade, etc. Yes Recommended for CI
brew install -y / --no-ask Single command Yes Per-command flag


Additional Resources:

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.