How to setup Homebrew (brew install) on macOS 12 Monterey

What is Homebrew

Homebrew is a package installer that helps you install the stuff you need that macOS 12 Monterey does not provide.

For example, you need PHP module, or you need some command-line tools. Most of those tools can be installed using Homebrew.

Please check https://brew.sh/ for more details.

Note:

Originally, this article is written targeted on macOS 12 Monterey. However, same steps should be applied and worked on macOS 13 Ventura.

How to Install Homebrew

By default, macOS 12 does not come with Homebrew preinstalled.

To install Homebrew, please check this page. or issue the following command in Terminal.

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

How to install package using brew

To install the Homebrew package, you use a command brew install <package name>.

For example, to install PHP package, type brew install php in the terminal

If you are getting the below error, you need to export the path.

zsh: command not found: brew

Export the path

Open the Terminal and type the below command and press Enter.

export PATH="/opt/homebrew/bin:$PATH"

then type the below command and press Enter.

echo 'export PATH="/opt/homebrew/bin:$PATH"' >> $HOME/.zshrc

Close the Terminal and re-open a new Terminal window.

How to check installed packages via Homebrew

To check the installed package, type brew list in the terminal.

How to uninstall installed packages

To removed the installed package, type brew uninstall --force <package name>

How to uninstall Homebrew

Follow the instruction in this page.

Latest Post

Feel free to share this post!

1 thought on “How to setup Homebrew (brew install) on macOS 12 Monterey”

  1. Pingback: How to Setup MAMP (MacOS, Apache, MySQL, PHP) on macOS 12 Monterey (2021) - Tech CookBook

Comments are closed.

Scroll to Top