DEV Community

rageshchalil
rageshchalil

Posted on

Install homebrew on MacOS Monterey - Apple M2

When you begin using a MacOS most life-saving package manager will always be Homebrew. As it is not installed by default on a Mac laptop, the below documentation will go through simple steps to install and configure it.

What is Homebrew?

Homebrew is an opensource package management system for MacOS(also Linux).

What has changed?

  • Apple replaced the default bash terminal to zsh in macOs Catalina.
  • The installation path of homebrew on Apple silicon (M1 chip and above) is /opt/ which is not part of default $PATH. The earlier versions would install under the path /usr/local/

Install Homebrew

  1. Open terminal and run,
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode
  1. Authenticate when prompted.
  2. Be patient...! (it might take 1 to 15 minutes to complete the installation)

Set path in .zprofile

Set environment for login shells by running below commands:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/<User>/.zprofile
Enter fullscreen mode Exit fullscreen mode

Replace <User> with your username

eval "$(/opt/homebrew/bin/brew shellenv)"
Enter fullscreen mode Exit fullscreen mode

Test

Run brew help you should be able to see different options brew offers.

Top comments (0)