Skip to main content

Homebrew

Homebrew is a package manager for macOS. It allows you to install and manage packages and applications from the command line.

Documentation

Installation

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

Keywords

  • Formulae - A formula is a package definition written in Ruby. It tells Homebrew how to download, configure, and install a package.

  • Casks - A cask is a package that installs an application on your system. It is a way to install GUI applications on your system.

  • Taps - A tap is a third-party repository for Homebrew. It is a collection of formulae and/or casks.

  • Bottles - A bottle is a pre-built binary package for a formula. It is a way to install a formula without building it from source.

  • Kegs - A keg is a folder that contains all the files of a formula or cask. It is the installation prefix of a formula or cask.

  • Cellar - A cellar is a folder that contains all the kegs. It is the installation prefix of Homebrew.

  • Brewfile - A Brewfile is a text file that contains a list of formulae and/or casks. It is a way to install multiple packages at once.

Commands

  • Check Homebrew version
brew -v
  • Update Homebrew
brew update
  • Install a package
brew install <package-name>
  • Uninstall a package
brew uninstall <package-name>
  • Upgrade a package
brew upgrade <package-name>
  • Upgrade all packages
brew upgrade
  • List all installed packages
brew list
  • List all the casks
brew list --cask
  • Search for a package
brew search <package-name>
  • Check if a package is installed
brew list | grep <package-name>
  • Check if a cask is installed
brew list --cask | grep <package-name>
  • Check version of a package
brew info <package-name>
  • Check version of a cask
brew info --cask <package-name>
  • Check outdated packages
brew outdated
  • Check outdated casks
brew outdated --cask
  • Stop a formula from being updated
brew pin <package-name>
  • Unpin a formula
brew unpin <package-name>
  • Create a Brewfile
brew bundle dump
  • Install packages from a Brewfile
brew bundle install
  • Update packages from a Brewfile
brew bundle dump --force
  • Cleanup the system packages according to the Brewfile
brew bundle cleanup --force