Homebrew, commonly known as Brew, is a free open-source software package management system that simplifies the installation of software on Apple’s macOS operating system. It is a must-have tool for developers, and in this blog post, we will guide you on how to install Brew on your Mac M1 chip.
Before we start, you need to ensure that your Mac has the following:
- A macOS running on M1 chip.
- A stable internet connection.
- The Xcode Command Line Tools installed.
Installing Xcode Command Line Tools
If you have not installed Xcode Command Line Tools yet, no worries. Just open your Terminal and type the following command:
This command will start the installation process of Xcode Command Line Tools.
Installing Brew on Mac M1
To install Brew on your Mac, you have two options: you can either install the Intel-based version of Brew into /usr/local, which will work for both Intel and Arm software, or you can install the new Arm-based version of Brew into /opt/homebrew, which is designed to work more efficiently with Arm software.
Installing Intel-based Version of Brew
To install the Intel-based version of Brew, type the following command into your Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Installing Arm-based Version of Brew
If you prefer to install the Arm-based version, you need to follow these steps:
- Press Command+Space and type Terminal to open the Terminal.
- Type the following command in your Terminal to navigate to your home directory: cd ~
- Now, use this command to install Brew:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
There you have it! You have successfully installed Brew on your Mac M1 chip. Now you can easily manage your software packages. Remember, you can always type brew help in Terminal to get a list of commands to use with Brew. Happy coding!