Things to know before installing Homebrew on Mac:
- It is compatible with Intel and Apple Silicon M1/M2 Mac chips.
- Available for macOS Big Sur and later.
- Xcode is a prerequisite
For years, Macs didn’t have a standard way to install command line tools, but that’s no longer the case. Homebrew is the perfect solution for easily installing third-party software on your Mac. With this software, you can access a large library of open source tools to help you modify your system and work more efficiently. In this article, I will show you how to install Homebrew on your Mac.
What is Homebrew on Mac?
Homebrew is a lightweight open source software package management system for Mac. You can use the program to install and administer numerous command line utilities and applications on your Mac. However, according to the software’s creators, “Homebrew is software that installs what you want and Apple doesn’t.”
With an easy-to-use interface, the software offers an extensive collection of packages that are easy to install and update with a few simple commands, making it ideal for those who want to update their software without any hassle.
With Homebrew, you can easily install tools and libraries such as Git, Python, Node.js, PHP, and more, and manage them easily with a simple command line interface. In addition, it is designed to be flexible, allowing you to customize the installation process and customize it to suit your specific requirements. Therefore, with the help of the program, you can optimize your workflow and increase your overall productivity.
Benefits of using Homebrew on Mac
- It is easy to install and set up. This requires just a few simple commands in the Terminal.
- It is very easy to manage different software packages on Mac. This simplifies the process of updating, installing and uninstalling software.
- It maintains a centralized repository of software packages, making it easy to find and install the software you need.
- The program is well supported as it is an open source package manager and anyone can contribute to its development.
- You save time as the software automates downloading, compiling and installing. This eliminates the need to search for software installers and manually run installation procedures.
- The Package Manager allows you to select which version of a particular software package you want to install and customize the installation.
- The program is designed for security and does not require root access to install the software to prevent security and vulnerabilities.
Requirements for installing Homebrew on Mac
Before we dive into the details of installing Homebrew on a Mac, let’s make sure your Mac meets the basic requirements to run the software:
- CPU: 64-bit Intel, Apple Silicon M1/M2
- macOS: Big Sur or later
- Command Line Tool (CLT): Xcode
- Installation: Bash (Bourne-again shell)
How to Install Homebrew on a Mac
Now that you’ve verified that your Mac meets all the requirements, check out the detailed steps to install Homebrew on your Mac.
Because installing Homebrew on a Mac requires you to write many lines of code in the Terminal, make sure you follow the instructions below carefully.
Install Command Line Tools for Xcode
Xcode is the native integrated development environment (IDE) for macOS. It provides a set of tools that developers use to build software such as compilers, build systems, and debuggers. Since Homebrew relies on command line tools, the Xcode application needs to be installed.
Follow the steps below to install Xcode on Mac.
- Open Spotlight (Cmd (⌘) + Space).
- Find and open Terminal.
- Write the following command
xcode-select --install
→ press the return key. - Select Install.
- After you have read the license agreement, select “Agree”.
- If your Mac is not connected to a power source, you may be prompted to do so. If there is sufficient charge, select “Continue battery power”.
- It will take some time to download the software.
- Complete the process by clicking Finish.
If your Mac won’t charge, you’ll be prompted with a dialog asking you to confirm booting with the existing battery.
Note. You can also use any other IDE that supports Mac development, but you must have it in order to access the command line tools that Homebrew requires.
Get Homebrew on Mac
Now that you’ve installed the IDE, here’s how to get Homebrew on a Mac. To do this, use the instructions below.
- Launch Terminal.
- Write the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
→ press the return key. - Now enter your Mac password.
- Press the return key on your keyboard to continue.
- You will now see a message on your screen saying that the installation was successful.
Congratulations! You have just finished installing Homebrew on your Mac. Please note that installation time may vary depending on your network connection and speed.
Note. If you’re having trouble installing Homebrew on a Mac M1, you can try these additional commands.
Set homebrew path
Once you’ve installed the Homebrew software, the next important step is to set up the path to ensure the program runs smoothly.
- Head to the Terminal.
- Copy the commands below one by one and press the return key after each command.
-
cd /opt/homebrew/bin/
-
ls
-
PATH=$PATH:/opt/homebrew/bin
-
cd
-
touch. zshrc
-
echo export PATH=$PATH:/opt/homebrew/bin ->. zshrc
-
brew doctor
-
As soon as the message “Your system is ready to brew” appears on the screen, you can proceed with confidence knowing that everything is ready to begin the brewing process.
Check Homebrew installation on macOS
Once you’ve installed Homebrew, the next suggested step is to check if the program installed successfully. You can simply do this using the instructions below.
- Open Terminal.
- You can try any of these commands:
-
brew –v
-
brew -version
-
brew doctor
-
- Now you will see that your system is ready to go.
Using this command will provide useful information about the status and performance of your Homebrew installation, allowing you to take the necessary steps to troubleshoot any problems you find.
How to disable Homebrew Analytics
Homebrew is free and open source software that collects data and shares it with developers to improve its user experience. As a result, if you don’t want to contribute or share your user information, you can close Homebrew Analytics.
Keep in mind that this step is optional, but I recommend that you follow the steps below and disable analytics to keep your data safe.
- Launch Terminal.
- Execute command
brew analytics off
.
Installing software with Homebrew
You can quickly install applications on your Mac after verifying that Homebrew is successfully installed and running. The procedure is simple and painless if the following steps are followed exactly:
- Open the Terminal app.
- Type the command
brew install {packageName}
into the terminal window. For example, to install the wget package, typebrew install wget
.
In the example above, I took the wget package as an example. Feel free to replace the package name with another package name. In addition, you can also check the list of packages installed on your Mac using the brew list
.
Keeping Homebrew up to date
To keep our software free of bugs and have up-to-date security features, it’s critical that Homebrew be updated regularly, just as we update macOS.
This practice allows you to take advantage of the latest features and get more compatibility, support, and improved functionality. Upgrading Homebrew is a simple process done through the Terminal by mirroring the steps below.
- Launch Terminal.
- Run the command
brew update
.
In addition to software, this command also expands installed packages to access the latest features as it updates them to the latest iterations.
How to remove Homebrew from Mac
If you decide to uninstall Homebrew from your Mac, you can easily do so by following the instructions outlined below.
- Launch Terminal.
- Run command
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
)"
- Enter y on the terminal screen.
- Enter your Mac password.
Great job! You have successfully removed Homebrew from your device.
Alternatively, you can avoid this issue by using the following command to uninstall Homebrew software non-interactively NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
.
How to remove Homebrew packages from Mac
However, if you prefer not to uninstall Homebrew, but want to uninstall or remove certain packages, you can easily achieve this by running the following commands.
- Open Terminal.
- Copy the command
brew uninstall wget
in the terminal window.
FAQ
No, Homebrew is optional for Mac. However, it can be a valuable tool for organizing packages and installing applications on your device.
Your Homebrew on M1 Mac Air is usually installed in the /usr/local/homebrew folder.
Indeed, you can use the Homebrew utility to easily install various graphics applications on your Mac.
Yes, Homebrew software works on Mac M2 computers. However, you may need to add an extra line of code during installation.
Much more about homebrewing…
Don’t like the easy way to install apps on your Mac? Whether you’re a developer, system administrator, or regular Mac user, Homebrew is an impressive tool that can boost your machine’s performance.
Haven’t installed Homebrew on your Mac yet? Try Homebrew today and see how it can improve your Mac experience!