Skip to content

brew MacOS command

Homebrew is a popular package manager for MacOS that simplifies the process of installing, updating, and managing software packages directly from the command line. With Homebrew, users can conveniently add new tools, libraries, and applications to their system without the need for manual installation steps. Whether you are a developer looking to streamline your workflow or a casual user seeking to enhance your MacOS experience, Homebrew offers a user-friendly and efficient solution for managing software dependencies. Its extensive library of available packages, straightforward syntax, and active community support make Homebrew a valuable tool for MacOS users of all levels.

brew Syntax:

Terminal window
brew [command] [formula]

Options:

OptionDescription
installInstall the specified formula
uninstallUninstall the specified formula
searchSearch for formulas
listList installed formulae
upgradeUpgrade outdated, unpinned formulae
pinPin the specified formula
unpinUnpin the specified formula
infoDisplay information about a formula
doctorCheck for potential issues
updateFetch the newest version of Homebrew
cleanupRemove old versions of installed formulae

Parameters:

ParameterDescription
commandThe specific action to be taken (e.g., install, uninstall)
formulaThe package to be acted upon

brew bash Examples:

Install a Package

Terminal window
brew install wget

Installs the “wget” package using Homebrew.

Search for a Package

Terminal window
brew search python

Searches for packages related to Python using Homebrew.

List Installed Packages

Terminal window
brew list

Displays a list of all installed packages using Homebrew.

Update Homebrew

Terminal window
brew update

Updates the list of available packages and their versions using Homebrew.

Uninstall a Package

Terminal window
brew uninstall wget

Removes the “wget” package installed via Homebrew.

Check for Vulnerabilities

Terminal window
brew audit --new

Checks for any known security vulnerabilities in installed packages using Homebrew.

How do I install a package using brew in MacOS?

To install a package using brew in MacOS, execute the following command:

Terminal window
brew install <package_name>

How do I search for a package using brew in MacOS?

To search for a package using brew in MacOS, execute the following command:

Terminal window
brew search <search_keyword>

How do I update brew and all the installed packages in MacOS?

To update brew and all the installed packages in MacOS, execute the following command:

Terminal window
brew update
brew upgrade

How do I uninstall a package using brew in MacOS?

To uninstall a package using brew in MacOS, execute the following command:

Terminal window
brew uninstall <package_name>

How do I list all installed packages with brew in MacOS?

To list all installed packages with brew in MacOS, execute the following command:

Terminal window
brew list

How do I show information about a specific package using brew in MacOS?

To show information about a specific package using brew in MacOS, execute the following command:

Terminal window
brew info <package_name>

How do I list the outdated packages with brew in MacOS?

To list the outdated packages with brew in MacOS, execute the following command:

Terminal window
brew outdated

Applications of the brew MacOS command

  • Installing and managing packages and software on MacOS
  • Updating installed packages
  • Searching for available packages
  • Managing package versions
  • Managing dependencies
  • Tapping into additional repositories
  • Managing services
  • Checking for common issues
  • Uninstalling packages