Things to know before installing Homebrew on Mac:
- It is compatible with both Intel and Apple Silicon chips M1/M2 Macs
- Available for macOS Big Sur and later
- Xcode is a pre-requisite
For years, Mac has lacked a standard way for installing command-line tools, but not anymore. Homebrew is the ultimate solution for making it easy to install third-party software on your Mac. With the software, you can access a large library of open-source tools, which can help you modify your system and operate more effectively. In this article, I’ll 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 apps on your Mac. However, according to the software creators, “Homebrew is a software that installs the stuff you need, but Apple didn’t.”
With an easy-to-use interface, the software offers a vast collection of packages that are easy to install and update using some simple commands, which makes it ideal for those who are looking to keep the software updated without any hassle.
With the help of Homebrew, you can easily install tools and libraries like Git, Python, Node.js, PHP, etc., and manage them effortlessly with the help of a simple command-line interface. Furthermore, it’s designed to be flexible, allowing you to customize the installation process and configure it to suit your specific requirements. Hence, with the program, you can streamline your workflow and improve overall productivity.
Benefits of using Homebrew on Mac
- It’s easy to install and set up. It requires only a few simple commands in the Terminal.
- Managing various software packages on a Mac is easy. It 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 maintained well as it’s an open-source package manager, and anyone can contribute to its development.
- You save time as the software automates the downloading, compiling, and installing. It eliminates the need to hunt down software installers and manually run installation procedures.
- The package manager lets you choose which version of a particular software package you want to install and customize the installation.
- The program is designed to be secure and doesn’t require root access to install the software to prevent security and vulnerabilities.
Requirements to install Homebrew on Mac
Before we deep dive into the details of installing Homebrew on Mac, let’s make sure your Mac matches the fundamental prerequisites for running 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 Mac
Now that you’ve ensured that your Mac meets all of the requirements, look at the detailed steps to install Homebrew on your Mac.
As installing Homebrew on Mac involves writing numerous lines of code in the Terminal, ensure that you explicitly follow the instructions mentioned below.
Install command line tools for Xcode
Xcode is a macOS native Integrated Development Environment (IDE). It provides a set of tools that developers use to create software, such as compilers, build systems, and debuggers. Because Homebrew relies on command-line tools, the Xcode application must be installed.
Follow the steps below to install Xcode on Mac.
- Open Spotlight (Cmd (⌘) + space Bar).
- Search and open Terminal.
- Write the following command
xcode-select --install
→ hit return. - Select Install.
- Once you’ve gone through the License Agreement, then choose Agree.
- If your Mac is not connected to a power source, you might be prompted to. If there’s enough charge, choose to Continue on Battery Power.
- It will take some time for the software to download.
- Complete the process by clicking Done.
If your Mac is not charging, you’ll be prompted a dialogue box that asks you to confirm the download over the existing battery.
Note: You can also use any other IDE that supports Mac development for the process, but you must have one to access the command-line tools that Homebrew requires.
Get Homebrew on Mac
Now that you’ve installed an IDE, here’s how to obtain Homebrew on Mac. To do so, use the instructions listed below.
- Launch Terminal.
- Write the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
→ hit return. - Now, enter your Mac password.
- Hit the return key on your keyboard to continue.
- Your screen will now display an Installation Successful message.
Congratulations! You’ve just finished installing Homebrew on your Mac.
Remember that the installation time can vary based on your network connection and speed.
Note: If you’re facing issues while installing Homebrew on M1 Macs, then you can try running these extra commands.
Set Homebrew path
Once you have installed the Homebrew software, the subsequent crucial step is to configure the path to ensure the seamless operation of the program.
- Head to Terminal.
- Copy the below-mentioned commands one by one and hit return 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
Once the message “Your system is ready to brew” appears on your screen, you can proceed confidently, knowing that everything is in place for you to begin your brewing process.
Verify Homebrew installation in macOS
When you’ve installed Homebrew, the next suggested step is to check and see if the program is successfully installed. You can simply accomplish this by using the instructions shown below.
- Open Terminal.
- You can try any of these commands:
brew –v
brew -version
brew doctor
- You’ll now see Your system is ready to brew.
Using this command will provide useful information on the health and performance of your Homebrew installation, allowing you to take the required steps to act on any issues discovered.
How to disable Homebrew analytics
Homebrew is free, open-source software that collects and shares data with developers to improve its user interface. As a result, if you don’t want to contribute or share your user information, you may shut down Homebrew analytics.
Remember that this step is optional, but I recommend you follow the steps underneath and disable analytics to keep your data safe and secure.
- Launch Terminal.
- Run command
brew analytics off
.
Installing software using Homebrew
You may quickly install apps on your Mac after validating Homebrew’s successful installation and functional operation. The procedure is simple and painless if the following steps are followed precisely:
- Open the Terminal app.
- Enter the command
brew install {packageName}
into the Terminal window.
For instance, to install the wget package, typebrew install wget
.
In the example stated above, I’ve taken the wget package as an example. Feel free to substitute the packageName with another packageName. Additionally, you can also check the list of packages installed on your Mac using the command brew list
.
Keeping Homebrew up to date
In order to ensure that our software is free from bugs and has up-to-date security features, it’s imperative to update Homebrew regularly, just as we update macOS.
This practice allows you to leverage the newest features and gain additional compatibility, support, and improved functionalities. Updating Homebrew is a straightforward process accomplished through the Terminal by mirroring the steps below.
- Launch Terminal.
- Run the command
brew update
.
In addition to the software, this command also enhances the installed packages to access the latest features as it updates them to their latest iterations.
How to uninstall Homebrew from Mac
If you have decided to remove Homebrew from your Mac, you may do it easily by following the instructions outlined below.
- Launch Terminal.
- Run the command
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
)"
- Type y in the Terminal screen.
- Enter your Mac password.
Excellent work! You have successfully removed Homebrew from your device.
Also, you can avoid this hassle by using the following command for a non-interactive Homebrew software removal NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
.
How to uninstall Homebrew packages from Mac
Nevertheless, if you prefer not to eliminate Homebrew but rather desire to uninstall or delete specific packages, you can effortlessly achieve that by executing the following commands.
- Open Terminal.
- Copy the command
brew uninstall wget
on the Terminal window.
FAQs
No, Homebrew is not mandatory for Mac. However, it may be a valuable tool for organizing packages and installing apps on your device.
Your Homebrew on your M1 Mac Air is typically installed in the /usr/local/homebrew.
Indeed, you can use the Homebrew utility to easily install various graphical apps on your Mac.
Yes, the Homebrew software does function on the M2 Macs. However, you may need to add an extra line of code when installing it.
So much more to Homebrew…
Are you not enjoying having a straightforward method to install apps on your Mac? Regardless of whether you’re a developer, sysadmin, or regular Mac user, Homebrew is an impressive tool that can elevate your machine’s performance.
Have you still not installed Homebrew on your Mac? Give Homebrew a try today and witness its ability to enhance your Mac experience! Additionally, remember to peruse my recommendations below.
You will also love to read:
- How to install Git on Mac
- How to use ChatGPT on Mac: 2 Ways explained!
- Best FTP clients for Mac
- How to set up and use Touch ID on Mac in macOS Ventura
Readers like you help support iGeeksBlog. When you make a purchase using links on our site, we may earn an affiliate commission. Read Disclaimer.
Excellent. Worked like a charm on Apple M1 chip
I appreciate the comment, Reedy!
Thanks Bhaskar, This work very well form me Apple M2 Chip
Happy to help!
i tried lot of time to instal homebrew in my macbook air M2 2022 but all the time error show and the error is
(curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75246 ms: Couldn’t connect to server)
show please solve my problem for this help i always thankfull to you
The error you’re encountering, “curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75246 ms: Couldn’t connect to server,” indicates that your Mac is unable to connect to GitHub’s servers during the Homebrew installation process. This could be due to a network connectivity issue or a DNS problem.
To resolve this error, you must ensure that you’re using a stable internet connection and use Google Public DNS.