Things to know before you install Homebrew on Mac:
- Works on both Intel and Apple Silicon chips.
- Available for macOS Big Sur and later.
- Xcode is required.
Mac has lacked a standard way to install command-line tools for years, but not anymore. Homebrew is the ultimate solution for making installing third-party software on your Mac easier. 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 the 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 that 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. This makes it ideal for those who want 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.
Also read: How to fix Mac Recovery Mode not working.
What are the benefits of Homebrew
Here are some of the benefits of using Homebrew on Mac:
- It’s easy to install and set up on macOS. It only requires a few simple commands in the Terminal and is ready to use.
- 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 finding and installing the software you need easy.
- 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.
- You may personalize the installation and select the version of a software package you wish to install using the package manager.
- In order to prevent security flaws and vulnerabilities, the program is created in a safe manner and doesn’t require root access to install.
Requirements to install Homebrew on Mac
Let’s make sure your Mac meets the basic requirements for running the program before delving into the specifics of installing Homebrew on Mac:
- CPU: 64-bit Intel, Apple Silicon.
- macOS: Big Sur and later.
- Command Line Tool (CLT): Xcode.
- Installation: Bash (Bourne-again shell).
Also read: How to MacBook trackpad not working.
How to install Homebrew on Mac
Now that you’ve ensured that your Mac meets all of the requirements, you can check how to install Homebrew on your Mac. Because installing Homebrew on Mac involves writing numerous lines of code in the Terminal, ensure that you explicitly follow the instructions mentioned below. Let’s get started without further ado!
Install command line tools for Xcode
Xcode is a macOS native Integrated Development Environment (IDE) that provides developers with a set of tools for creating software, such as compilers, build systems, and debuggers. Because Homebrew relies on command-line tools, the Xcode application must be installed.
As a result, Xcode must be installed. Adhere to the steps below to install Xcode on Mac.
1. Open Spotlight (Command + Space Bar).
2. Search and open Terminal.
3. Write the following command xcode-select –install.
4. Select Install.
5. Once you’ve gone through the License Agreement, then choose Agree.
6. Complete the process by clicking Done.
If your Mac is not charging, you’ll be prompted with 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, you can obtain Homebrew on a Mac using the instructions listed below.
1. Launch Terminal.
2. Write the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".
3. Give access by entering your device password.
4. Your device password won’t be displayed on the screen.
5. 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 next crucial step is to configure the path to ensure the program’s seamless operation.
1. Head to Terminal.
2. Run the below-mentioned commands one by one:
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 to see if the program has been successfully installed. You can accomplish this by using the instructions shown below.
1. Open Terminal.
2. Type the command bellow and hit Enter.
brew –version
Other than that, brew doctor is a command in the Homebrew package management that offers helpful information about the current state, prospective issues, and available updates.
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 and open-source software that collects and shares data with developers to improve its user interface. If you don’t want to contribute or share your user information, you may shut down Homebrew analytics.
Although you are under no obligation to follow this step, I advise you to disable analytics by following the instructions below to protect your data.
1. Launch Terminal.
2. Run the following 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. If the following stages are carefully followed, the operation is straightforward and painless:
1. Open the Terminal app.
2. Enter the following command into the Terminal window.
brew install {packageName}
3. For instance, to install the wget package, type:
brew install wget
In the example above, I’ve used the wget package. Feel free to substitute the packageName with another packageName. Additionally, you can check the list of packages installed on your Mac using the command brew list.
Keeping Homebrew up-to-date
It’s imperative to update Homebrew regularly, just as we update macOS, to ensure that our software is free from bugs and has up-to-date security features.
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.
1. Launch Terminal.
2. Type the below mentioned and hit Enter.
brew update
This command enhances the software and installed packages to access the latest features by updating them to their latest iterations.
Also read: How to use Switch Control on iPhone, iPad, and Mac.
How to uninstall Homebrew from Mac
If you have decided to remove Homebrew from your Mac, you can easily do so by following the instructions outlined below.
1. Launch Terminal.
2. Run the command and press Enter.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)".
3. Type y in the Terminal screen.
4. Enter your Mac password.
Fantastic job! Homebrew has been successfully deleted 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.
1. Open Terminal.
2. Copy the command below on the Terminal window and hit the Enter key.
brew uninstall wget
So much more to Homebrew
Do you not enjoy having a straightforward method for installing apps on your Mac? Homebrew is an impressive tool that can elevate your machine’s performance, whether you’re a developer, sysadmin, or regular Mac user.
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.
FAQs
No, Homebrew is not a must for a Mac. However, it might be useful if you want to install software and organize packages on your computer.
Your Homebrew on Mac is typically installed in the /usr/local/ homebrew.
Indeed, you can use the Homebrew utility to easily install various graphical apps on your Mac.
Was this helpful?
Introducing Bhaskar, your tech-savvy neighbor turned wordsmith extraordinaire. Over the past few years, Bhaskar has become the trusted authority for unraveling the mysteries of iOS, Android, macOS, and Windows. Armed with a B.Tech degree, he has dedicated himself to making technology easy to understand for everyone. His expertise shines through his contributions to well-known publications like Guiding Tech, iGeeksBlog, GeekFrost, and MakeUseOf (MUO). Bhaskar excels in creating straightforward how-to guides and comprehensive articles that make the complex tech landscape accessible to all. When he's not diving into the tech world, you'll find him enjoying music or indulging in sports.