Skip to content
Search

Homebrew

lastmod 2026-02-12created 2015-01-1514 edits

How to install brew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The important thing is not to use administrator privileges (sudo).

Help message

Example usage:
  brew [info | home | options ] [FORMULA...]
  brew install FORMULA...
  brew uninstall FORMULA...
  brew search [foo]
  brew list [FORMULA...]
  brew update
  brew upgrade [FORMULA...]
  brew pin/unpin [FORMULA...]

Troubleshooting:
  brew doctor
  brew install -vd FORMULA
  brew [--env | config]

Brewing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md

Further help:
  man brew
  brew home

List of Packages

wxMac

$ brew install wxmac

OpenCV

$ brew tap homebrew/science
$ brew install opencv

FFmpeg

$ brew install ffmpeg

Homebrew private repository

Troubleshooting

The linking step did not complete successfully

While installing a package, the installation may fail with an error message like the following.

The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local

A related message, Permission denied, may also be printed. In this case, first run an update as below.

$ brew update

After that, if it still does not install properly when you retry, change the ownership with chown as below.

$ sudo chown -R $(whoami):admin /usr/local

homebrew-core is a shallow clone

Running the brew update command may produce the following error.

Error:
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

In plain terms:

  • These commands may take a few minutes to run because the repositories are large.
  • This restriction was applied at GitHub's request, because updating a shallow clone is a very expensive operation due to the traffic and tree layout of Homebrew/homebrew-core and Homebrew/homebrew-cask.
  • It is not done automatically, to avoid repeatedly performing an expensive shallow operation in CI systems (instead, those should be fixed to not use shallow clones).

So try again as follows:

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
brew update

See also

Favorite site

author Zer0 sitemap