Just as there are veteran coders who know all the tricks to streamline their work, there are also novices and even some veterans who struggle with these tricks. You’re likely in one of these groups, and you’d be amazed at how many others are too.
Whether you’re testing the waters with a personal software project or working for clients, you’ll need various packages from Node.js to bcrypt, Python, Ruby, and MongoDB Compass. But don’t worry, Homebrew has got your back. It simplifies the management of these packages, so you don’t have to stress over it.
All it takes is a few commands in your Homebrew-supercharged Mac terminal, and you’re all set.
Now, let’s show you how to smoothly install this powerful tool, Homebrew, on your Mac. We’ve been singing its praises because it truly delivers. And keep in mind, there is more helpful information waiting for you in this post.
What is Homebrew?
For developers who love the Mac environment but wish for more access, Homebrew is the answer. Homebrew, a free and open-source software package management system launched in 2009, is designed to break down those barriers for you. It offers a wide range of packages for macOS and Linux.
Homebrew is an excellent tool for effectively managing your development tools. It automates your workflow. With Homebrew, all your packages are installed, updated, and uninstalled in one location on your Mac. You just need to type a few words to perform your desired actions.
For example, `brew upgrade` updates all outdated packages, so no more jumping between directories to run `npm update bcrypt` here and `pip install –upgrade requests` there — just the tip of the iceberg.
Homebrew automatically handles software dependencies, provides clean uninstallation, verifies the integrity of packages before installing them, manages versions, and uses “formulas” to define how a package is installed. It’s a flexible tool that’s perfect for learning the command line if you’re new to it (using the tldr resource), and it’s ideal for those who frequently install software, without the hassle.
With Homebrew, you get a personalised Mac experience. The name “Homebrew” itself suggests this — it’s kind of having your own espresso machine at home, brewing a cup of coffee that’s made just for you.
Prerequisites for Installing Homebrew
You’re probably raring to go, thinking, “Let’s get Homebrew up and running on my Mac!” But hold on, let’s first check if your computer meets the necessary requirements for Homebrew.
- 64-bit Intel CPU or Apple Silicon CPU: Homebrew is optimised for 64-bit architecture, so this is a must.
- macOS Monterey (12) or higher: To ensure compatibility with the latest features and security updates. Older versions of macOS may also work.
- Command Line Tools (CLT) for Xcode: These are needed to provide the necessary compilers and tools.
- Bourne-compatible shell for installation (e.g., bash or zsh): Homebrew uses shell scripts for its operation.
Step-by-Step Guide to Install Homebrew
At last, we’ve reached the climax! If you thought the previous sections were hot, this one’s going to be even more so. We’re about to explore the most efficient method to install Homebrew on your Mac — using curl to fetch the installation script.
Step 1: Open Terminal
First things first, let’s open the Terminal. Simply use Spotlight (COMMAND + SPACE) and type in “Terminal”. If you’re more of a “I-know-where-I’m-going” type, you can find the Terminal in the Utilities folder within the Applications folder.
Step 2: Install Xcode Command Line Tools
If you’ve used Windows before, think of Xcode as the macOS equivalent of Visual Studio IDE. It’s packed with resources that Homebrew needs to function.
With your Terminal open and ready, enter the following command to install Xcode command line tools:
`xcode-select –install`
When the prompt appears, click “Install”. Agree to the Xcode Licence Agreement in the next prompt if you’re okay with the terms. The installation speed will depend on your machine’s performance.
Step 3: Install Homebrew
With your Terminal now primed with the new additions, it’s time to install Homebrew. Run the following command to download the Homebrew installation script:
`/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”`
Next, you’ll be asked to enter your Administrator password. Even though you won’t see what you’re typing, keep going — it’s a security feature. After entering your password, press the RETURN key.
A prompt will then show up. Press the ‘y’ key for “yes” to greenlight the installation of Homebrew on your machine. Get ready to celebrate when you see the “Installation Successful” message!
Making the Most of Homebrew on Mac
Surely, there’s more to Homebrew than just installation. You need a map to step into this dimension of endless possibilities, which is where the `brew help` command comes in. Just run it in the Terminal.
Installing, Upgrading, and Uninstalling Packages
Executing that command will display a range of sample commands, from installing your first package with `brew install [package name]`, to troubleshooting issues with `brew doctor`.
Now that we’ve covered some basic commands, it’s time to go deeper into Homebrew.
If your system starts to feel sluggish, it might be time to update your packages. Use `brew outdated` to see what needs updating, then use `brew upgrade [package name]` to update individual packages, or `brew upgrade` to update all outdated packages at once.
You can use `brew update` to update Homebrew itself. If you’re certain a package is no longer needed, use `brew uninstall [package name]` to remove it.
Turning off Analytics
As Homebrew is a free open-source solution, your data, such as The Homebrew user agent and Homebrew analytics tracking ID, might be shared with developers worldwide.
If you’re privacy-conscious or simply dislike unnecessary background processes, you can opt-out with `brew analytics off` and confirm the status with `brew analytics`.
How to Uninstall Homebrew
Only you know why you’ve chosen this path. But don’t worry, curl simplifies* the uninstallation process, too.
You can use the command below to download the uninstall script and start the removal process:
`curl -fsSL -o uninstall.sh https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh`
After reading the warning about what will be deleted, you can execute the script with the `–help` flag to choose your uninstallation option:
`bash uninstall.sh –help`
If you decide to remove “everything”, run `bash uninstall.sh`.
Fighting Clutter
Speaking of “curl simplifies the uninstallation process”, that’s a bit of a stretch. Over time, Homebrew, in its quest to give you extra features, leaves behind clutter. You need to remove these to potentially improve your machine’s performance.
You can use `brew cleanup -n` in Terminal to check how much space the junk is taking up. Aiseesoft Mac Cleaner and CleanMyMac X are among the few apps that can truly uninstall Homebrew, its packages, files and junk.
Beyond Homebrew: Discover a Sharper Display
If you’re still wrestling with the command line even after our wholehearted guide on how to install Homebrew, then Setapp might just be what you need. It’s a simpler, GUI-based alternative for managing your coding tools and even writing code. It brings more clarity to your workflow.
But that’s not all. Alongside these tools, Setapp offers a collection of over 240+ curated apps spanning productivity tools, media management, design, customisation, Mac storage management, and more. With features including one-click install and uninstall and automatic app updates, Setapp makes managing your apps a breeze.
And the best part? All this power can be yours for a tiny monthly subscription of just $9.99.
Concluding With Apps
For you, the coder who has already ascended to the throne of the command line kingdom, continue to exercise your authority over Homebrew, the top free package management solution.
If you’re still on your journey to becoming a command line king or queen, don’t worry, you’ll get there. In the meantime, Setapp is here to welcome you with a fresh way to use your Mac.
Just tell Setapp what you want to accomplish, and it will immediately present you with a suitable app. Give it a try with a no-commitment 7-day free trial.