Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Manpage.md 70.06 KiB

brew(1) -- The Missing Package Manager for macOS

SYNOPSIS

brew --version
brew command [--verbose|-v] [options] [formula] ...

DESCRIPTION

Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn't include with macOS.

ESSENTIAL COMMANDS

For the full command list, see the COMMANDS section.

With --verbose or --debug, many commands print extra debugging information. Note that these options should only appear after a command.

install formula:

Install formula.

formula is usually the name of the formula to install, but it has other syntaxes which are listed in the SPECIFYING FORMULAE section.

uninstall formula:

Uninstall formula.

list:

List all installed formulae.

search (text|/text/):

Perform a substring search of cask tokens and formula names for text. If text is flanked by slashes, it is interpreted as a regular expression. The search for text is extended online to homebrew/core and homebrew/cask. If no search term is provided, all locally available formulae are listed.

COMMANDS

analytics [subcommand]

Control Homebrew's anonymous aggregate user behaviour analytics. Read more at https://docs.brew.sh/Analytics.

brew analytics [state]: Display the current state of Homebrew's analytics.

brew analytics [on|off]: Turn Homebrew's analytics on or off respectively.

brew analytics regenerate-uuid: Regenerate the UUID used for Homebrew's analytics.

cask command [options] [cask]

Homebrew Cask provides a friendly CLI workflow for the administration of macOS applications distributed as binaries.

Commands:

  • --cache
    Display the file used to cache a cask

  • audit
    Check cask for Homebrew coding style violations

  • cat
    Dump raw source of a cask to the standard output

  • create
    Creates the given cask and opens it in an editor

  • doctor
    Checks for configuration issues

  • edit
    Open the given cask for editing

  • fetch
    Downloads remote application files to local cache

  • help
    Print help for cask commands

  • home
    Opens the homepage of the given cask

  • info
    Displays information about the given cask

  • install
    Installs the given cask

  • list
    Lists installed casks or the casks provided in the arguments

  • outdated
    List the outdated installed casks

  • reinstall
    Reinstalls the given cask

  • style
    Checks style of the given cask using RuboCop

  • uninstall
    Uninstalls the given cask

  • upgrade
    Upgrades all outdated casks or the specified casks

  • zap
    Zaps all files associated with the given cask

See also: man brew

  • --appdir: Target location for Applications. Default: /Applications
  • --colorpickerdir: Target location for Color Pickers. Default: ~/Library/ColorPickers
  • --prefpanedir: Target location for Preference Panes. Default: ~/Library/PreferencePanes
  • --qlplugindir: Target location for QuickLook Plugins. Default: ~/Library/QuickLook
  • --mdimporterdir: Target location for Spotlight Plugins. Default: ~/Library/Spotlight
  • --dictionarydir: Target location for Dictionaries. Default: ~/Library/Dictionaries
  • --fontdir: Target location for Fonts. Default: ~/Library/Fonts
  • --servicedir: Target location for Services. Default: ~/Library/Services
  • --input_methoddir: Target location for Input Methods. Default: ~/Library/Input Methods
  • --internet_plugindir: Target location for Internet Plugins. Default: ~/Library/Internet Plug-Ins
  • --audio_unit_plugindir: Target location for Audio Unit Plugins. Default: ~/Library/Audio/Plug-Ins/Components
  • --vst_plugindir: Target location for VST Plugins. Default: ~/Library/Audio/Plug-Ins/VST
  • --vst3_plugindir: Target location for VST3 Plugins. Default: ~/Library/Audio/Plug-Ins/VST3
  • --screen_saverdir: Target location for Screen Savers. Default: ~/Library/Screen Savers
  • --language: Set language of the Cask to install. The first matching language is used, otherwise the default language on the Cask. The default value is the language of your system

cleanup [options] [formula|cask]

Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae. If arguments are specified, only do this for the given formulae and casks. Removes all downloads more than 120 days old. This can be adjusted with HOMEBREW_CLEANUP_MAX_AGE_DAYS.

  • --prune: Remove all cache files older than specified days.
  • -n, --dry-run: Show what would be removed, but do not actually remove anything.
  • -s: Scrub the cache, including downloads for even the latest versions. Note downloads for any installed formulae or casks will still not be deleted. If you want to delete those too: rm -rf "$(brew --cache)"
  • --prune-prefix: Only prune the symlinks and directories from the prefix and remove no other files.

commands [options]

Show lists of built-in and external commands.

  • -q, --quiet: List only the names of commands without category headers.
  • --include-aliases: Include aliases of internal commands.

config

Show Homebrew and system configuration info useful for debugging. If you file a bug report, you will be required to provide this information.

deps [options] [formula]

Show dependencies for formula. Additional options specific to formula may be appended to the command. When given multiple formula arguments, show the intersection of dependencies for each formula.

  • -n: Sort dependencies in topological order.
  • --1: Only show dependencies one level down, instead of recursing.
  • --union: Show the union of dependencies for multiple formula, instead of the intersection.
  • --full-name: List dependencies by their full name.
  • --include-build: Include :build dependencies for formula.
  • --include-optional: Include :optional dependencies for formula.
  • --include-test: Include :test dependencies for formula (non-recursive).
  • --skip-recommended: Skip :recommended dependencies for formula.
  • --include-requirements: Include requirements in addition to dependencies for formula.
  • --tree: Show dependencies as a tree. When given multiple formula arguments, show individual trees for each formula.
  • --annotate: Mark any build, test, optional, or recommended dependencies as such in the output.
  • --installed: List dependencies for formulae that are currently installed. If formula is specified, list only its dependencies that are currently installed.
  • --all: List dependencies for all available formulae.
  • --for-each: Switch into the mode used by the --all option, but only list dependencies for each provided formula, one formula per line. This is used for debugging the --installed/--all display mode.

desc [options] (text|/text/|formula)

Display formula's name and one-line description. Formula descriptions are cached; the cache is created on the first search, making that search slower than subsequent ones.

  • -s, --search: Search both names and descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression.
  • -n, --name: Search just names for text. If text is flanked by slashes, it is interpreted as a regular expression.
  • -d, --description: Search just descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression.

doctor [options]

Check your system for potential problems. Will exit with a non-zero status if any potential problems are found. Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this.

  • --list-checks: List all audit methods, which can be run individually if provided as arguments.
  • -D, --audit-debug: Enable debugging and profiling of audit methods.

fetch [options] formula

Download a bottle (if available) or source packages for formula. For tarballs, also print SHA-256 checksums.

  • --HEAD: Fetch HEAD version instead of stable version.
  • --devel: Fetch development version instead of stable version.
  • -f, --force: Remove a previously cached version and re-fetch.
  • -v, --verbose: Do a verbose VCS checkout, if the URL represents a VCS. This is useful for seeing if an existing VCS cache has been updated.
  • --retry: Retry if downloading fails or re-download if the checksum of a previously cached version no longer matches.
  • --deps: Also download dependencies for any listed formula.
  • -s, --build-from-source: Download source packages rather than a bottle.
  • --build-bottle: Download source packages (for eventual bottling) rather than a bottle.
  • --force-bottle: Download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation.

gist-logs [options] formula

Upload logs for a failed build of formula to a new Gist. Presents an error message if no logs are found.

  • --with-hostname: Include the hostname in the Gist.
  • -n, --new-issue: Automatically create a new issue in the appropriate GitHub repository after creating the Gist.
  • -p, --private: The Gist will be marked private and will not appear in listings but will be accessible with its link.

home [formula]

Open formula's homepage in a browser, or open Homebrew's own homepage if no formula is provided.

info [options] [formula]

Display brief statistics for your Homebrew installation.

If formula is provided, show summary of information about formula.

  • --analytics: List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither HOMEBREW_NO_ANALYTICS nor HOMEBREW_NO_GITHUB_API are set).
  • --days: How many days of analytics data to retrieve. The value for days must be 30, 90 or 365. The default is 30.
  • --category: Which type of analytics data to retrieve. The value for category must be install, install-on-request or build-error; cask-install or os-version may be specified if formula is not. The default is install.
  • --github: Open the GitHub source page for formula in a browser. To view formula history locally: brew log -p formula
  • --json: Print a JSON representation of formula. Currently the default and only accepted value for version is v1. See the docs for examples of using the JSON output: https://docs.brew.sh/Querying-Brew
  • --installed: Print JSON of formulae that are currently installed.
  • --all: Print JSON of all available formulae.
  • -v, --verbose: Show more verbose analytics data for formula.

install [options] formula

Install formula. Additional options specific to formula may be appended to the command.

Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for the installed formulae or, every 30 days, for all formulae.

  • -d, --debug: If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.
  • --env: If std is passed, use the standard build environment instead of superenv. If super is passed, use superenv even if the formula specifies the standard build environment.
  • --ignore-dependencies: An unsupported Homebrew development flag to skip installing any dependencies of any kind. If the dependencies are not already present, the formula will have issues. If you're not developing Homebrew, consider adjusting your PATH rather than using this flag.
  • --only-dependencies: Install the dependencies with specified options but do not install the formula itself.
  • --cc: Attempt to compile using the specified compiler, which should be the name of the compiler's executable, e.g. gcc-7 for GCC 7. In order to use LLVM's clang, specify llvm_clang. To use the Apple-provided clang, specify clang. This option will only accept compilers that are provided by Homebrew or bundled with macOS. Please do not file issues if you encounter errors while using this option.
  • -s, --build-from-source: Compile formula from source even if a bottle is provided. Dependencies will still be installed from bottles if they are available.
  • --force-bottle: Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation.
  • --include-test: Install testing dependencies required to run brew test formula.
  • --HEAD: If formula defines it, install the HEAD version, aka. master, trunk, unstable.
  • --fetch-HEAD: Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will only be checked for updates when a new stable or development version has been released.
  • --keep-tmp: Retain the temporary files created during installation.
  • --build-bottle: Prepare the formula for eventual bottling during installation, skipping any post-install steps.
  • --bottle-arch: Optimise bottles for the specified architecture rather than the oldest architecture supported by the version of macOS the bottles are built on.
  • -f, --force: Install without checking for previously installed keg-only or non-migrated versions.
  • -v, --verbose: Print the verification and postinstall steps.
  • --display-times: Print install times for each formula at the end of the run.
  • -i, --interactive: Download and patch formula, then open a shell. This allows the user to run ./configure --help and otherwise determine how to turn the software package into a Homebrew package.
  • -g, --git: Create a Git repository, useful for creating patches to the software.

leaves

List installed formulae that are not dependencies of another installed formula.

link, ln [options] formula

Symlink all of formula's installed files into Homebrew's prefix. This is done automatically when you install formulae but can be useful for DIY installations.

  • --overwrite: Delete files that already exist in the prefix while linking.
  • -n, --dry-run: List files which would be linked or deleted by brew link --overwrite without actually linking or deleting any files.
  • -f, --force: Allow keg-only formulae to be linked.

list, ls [options] [formula|cask]

List all installed formulae or casks

If formula is provided, summarise the paths within its current keg.