LinuxCommandLibrary

brew-bundle

Install multiple Homebrew packages from a Brewfile

TLDR

Install packages from a Brewfile at the current path

$ brew bundle
copy

Install packages from a specific Brewfile at a specific path
$ brew bundle --file [path/to/file]
copy

Create a Brewfile from all installed packages
$ brew bundle dump
copy

Uninstall all formulae not listed in the Brewfile
$ brew bundle cleanup --force
copy

Check if there is anything to install or upgrade in the Brewfile
$ brew bundle check
copy

List all entries in the Brewfile
$ brew bundle list --all
copy

SYNOPSIS

brew bundle [subcommand] [options] [--file[=path]] [Brewfile]

PARAMETERS

--file=path
    Use custom Brewfile instead of Brewfile or ~/.Brewfile.

--global
    Read/write global Brewfile from XDG_CONFIG_HOME or ~/.Brewfile.

--verbose
    Print install steps verbosely.

--force
    Force actions like cleanup, ignoring dependencies.

--dry-run
    Simulate actions without changes.

--cleanup
    Remove non-Brewfile packages (used with install).

install
    Install formulae/casks/taps from Brewfile.

dump
    Generate Brewfile from installed items.

cleanup
    Uninstall non-Brewfile items.

check
    Verify Brewfile matches installed items.

exec
    Execute command in bundle context.

DESCRIPTION

brew bundle is a Homebrew subcommand for managing bundles of software packages defined in a Brewfile. It enables users to declaratively install, update, or clean up multiple formulae, casks, and taps in one go, ideal for reproducible environments.

On Linux (via Linuxbrew), it installs formulae (CLI tools) and manages taps, though casks (GUI apps) are limited compared to macOS. Create a Brewfile with lines like brew 'wget', tap 'homebrew/science', then run brew bundle install to fetch everything.

Key uses: team setups, dotfiles integration, CI/CD pipelines. It audits installs, skips existing packages, and supports global Brewfiles (~/.Brewfile). Enhances Homebrew's portability across macOS/Linux setups.

CAVEATS

Linuxbrew has no cask support; some formulae may need linux variants. Requires brew installed. Global flag uses XDG_CONFIG_HOME (~/.config/homebrew on Linux).

BREWFILE FORMAT

YAML-like: brew 'git', cask 'firefox' (macOS), tap 'user/repo', brew 'node', args: ['--HEAD'].

LINUX NOTES

Use linuxbrew fork; install via script. Bundles focus on CLI tools, no GUI casks.

HISTORY

Introduced in Homebrew 1.1.0 (2017) as brew bundle for Brewfile support. Evolved with Linuxbrew integration (2014+), now core for reproducible installs. Active in Homebrew core repo.

SEE ALSO

brew(1), homebrew(1)

Copied to clipboard