TL;DR
|
A few years in the past, I had no clue what Homebrew was or why I’d want it. The primary time I opened Terminal to put in it, I used to be curious and barely terrified. So should you’re feeling overwhelmed, I get it.
That’s why I put collectively this easy, beginner-friendly information to stroll you thru putting in (and uninstalling) Homebrew in your Mac. I’ll additionally share a couple of useful alternate options I’ve found alongside the best way, simply in case you’re not into command traces.
What’s Homebrew, and the way does it work?
Homebrew is a free and open-source bundle supervisor for macOS that helps you put in, replace, uninstall, and handle developer instruments like Python, Ruby, and Node.js in your Mac.
With Homebrew, you may profit from many command-line instruments to automate your work. Better of all, they’re all put in, uninstalled, and up to date in a single location in your Mac.
Listed here are just some examples of the helpful instruments you may get via Homebrew:
- imagemick to transform photos to different codecs
- archey to share the localhost along with your workforce
- hub for a greater expertise with Git
- tldr for sensible examples on tips on how to use the command line
To make it simpler to observe, I will keep away from the coding jargon and will not dive into how Homebrew works beneath the hood. The primary factor it is best to know as a consumer is that Homebrew acts via Terminal instructions. You’ll be able to set up, replace, and uninstall packages by typing a couple of phrases.
There are some easy default brew instructions for putting in single-file utilities and extra superior subcommands known as casks. You’ll have to make use of these to put in multi-directory utilities.
Necessities to put in Homebrew on Mac
Earlier than you dive into the method, be sure that your macOS meets the next necessities:
- Apple Silicon or 64-bit CPU
- macOS Ventura (13) or later
- Bourne-compatible shell (bash or zsh syntax)
- Xcode’s command line instruments (I will clarify tips on how to set up the instruments within the following part)
The best way to set up Homebrew on Mac
Transferring to the primary half, how do you put in Homebrew on Mac? Only a heads up, the set up methodology I describe makes use of the curl command to obtain the set up script. This methodology is the best, and it’s really useful by the Homebrew workforce.
The identical applies to the method of uninstalling Homebrew. Since some folks don’t wish to use the curl command for safety causes, there are methods to manually obtain and execute the script (however I received’t go into that right here).
Step 1: Set up command-line instruments for Xcode
Xcode is Apple’s native IDE, an built-in growth surroundings that has all of the instruments you want for software program growth on Mac. To put in a number of the Homebrew bundle parts, it’s essential set up Xcode’s command line instruments first (in case you haven’t executed it earlier than).
Right here’s tips on how to set up command-line instruments for Xcode:
- Open Terminal (Functions > Utilities) and kind the next command:
xcode-select --install
. - Affirm that you simply wish to set up the Xcode instruments within the new dialog window.
- Comply with the license settlement and look forward to the set up course of to finish. It’d take some time.
Step 2: Set up Homebrew on Mac
Now your Mac is prepared for Homebrew. Right here’s the total set up course of:
- Open Terminal and kind the next command:
/bin/bash -c "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/set up.sh)"
. - Kind your admin password (observe that you simply received’t see your keystrokes within the Terminal window; it’s a safety measure) > Press Return.
- Wait a couple of minutes till you see the “Set up profitable” message in Terminal.
Step 3: Flip off analytics
This isn’t an compulsory step, however I at all times flip off analytics. Homebrew can share a few of your information with builders for the reason that device is free and open-source.
It collects: set
- Homebrew Person Agent
- Google Analytics model
- Homebrew analytics monitoring ID
- Homebrew analytics consumer ID
- Whether or not nameless IP monitoring is enabled
Should you don’t need your information to be collected and shared with the Homebrew builders, the command it is best to run in Terminal to show off analytics is: brew analytics off
.
Step 4: Arrange Homebrew
Now that Homebrew is put in, open Terminal and run brew assist
to get began. You’ll see examples of instructions that can enable you set up completely different software program, configs, and updates via Homebrew.
For instance, to put in a bundle, it is best to kind brew set up “bundle identify”
in Terminal. There are additionally a couple of helpful troubleshooting instructions it is best to pay attention to, reminiscent of brew physician
, to detect set up points.
Step 5: Replace Mac Homebrew
Something you put in by way of Homebrew must be up to date frequently. You must also replace the bundle supervisor often to verify it really works correctly and that you simply’re not lacking some essential new options:
- To replace Homebrew, run brew replace in Terminal.
- To seek out out what packages want updating, run brew outdated in Terminal.
- To replace a selected bundle, run brew replace bundle identify in Terminal.
Private tipShould you typically use Homebrew to handle Git-related instruments, try Gitfox. I switched from utilizing the hub command to Gitfox, and it truthfully made issues a lot simpler. Clear interface, sensible Git workflows, and approach quicker commits. |
Establishing Homebrew PATH in macOS Sonoma
Working into issues with Zsh if you’re making an attempt to execute a script or run instructions isn’t uncommon in any respect. For this reason it is best to correctly arrange Homebrew to be reachable with the PATH surroundings variable.
You are able to do this on Intel-based Macs with these steps:
- Open your .zshrc file in a textual content editor.
- Add the Homebrew path on the finish of the file utilizing this line:
export PATH="/usr/native/bin:$PATH"
and save the modifications. - Shut and reopen Terminal, then run the command
supply ~/.zshrc
. - Open a brand new Terminal window and run
brew --version
. If Homebrew has been correctly added to PATH, Terminal will return its model.
For Apple Silicon Macs, use the command: eval "$(/choose/homebrew/bin/brew shellenv)"
.
Troubleshooting Homebrew set up
As a Homebrew consumer, you might face both of those two frequent points, so right here’s tips on how to work round them:
- command not discovered: brew: Repair this with a PATH examine:
echo $PATH
. - Permission denied: Repair this with
sudo chown -R $(whoami):admin /choose/homebrew
.
With all this in thoughts, now you can depend on Homebrew instantly via your Terminal for numerous package-related actions, reminiscent of putting in, updating, and uninstalling.
Private tipTruthfully, I really like Homebrew, however it doesn’t cowl every little thing. Typically I simply wish to shortly format some JSON or decode a string with out leaping via hoops or being on-line. That’s once I attain for DevUtils [=https://setapp.com/apps/devutils.app]. It runs domestically on my Mac and handles all these little dev duties that often ship me down a Google rabbit gap. I didn’t anticipate to make use of it as a lot as I do, however now it’s one of many first apps I open once I began working. |
The best way to uninstall Homebrew from Mac
If it’s essential uninstall Homebrew for no matter cause, right here’s tips on how to shortly do it:
- Open Terminal.
- Run the Uninstall script. This script will information you thru the uninstallation course of and take away Homebrew and its related recordsdata.
- Kind
/bin/bash -c "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/uninstall.sh)"
.
This may launch the official Homebrew uninstall script, which guides you thru the method and removes Homebrew out of your system.
The best way to uninstall Homebrew packages from Mac
Should you don’t wish to eliminate the bundle supervisor itself, however somewhat take away particular packages, you may completely try this.
Right here’s how:
- Make sure that there are not any dependencies between the bundle you wish to delete and those which are in use by operating the next command:
brew deps bundle identify
. - Kind the next:
brew uninstall --ignore-dependencies bundle identify
should you’ve discovered dependencies and resolve to disregard them. - Run the command:
brew uninstall bundle identify
to uninstall the bundle.
What’s new in Homebrew?
Homebrew has made vital enhancements in growth since 2021, together with the much-awaited native Apple Silicon help and quicker dependency dealing with. In case your undertaking wants instruments like Node and wget, Homebrew can now enable you set them as much as work correctly.
It additionally now boasts improved command analytics, with the analytics aspect underpinned by InfluxDB. You’ll be able to execute Homebrew-managed updates quicker due to the current change from Git-cloned faucets to JSON downloads.
Ultimate ideas on tips on how to set up Homebrew on Mac
Establishing Homebrew on my Mac turned out to be approach simpler than I anticipated. As soon as I bought via the preliminary steps in Terminal, I might set up and handle all types of instruments with no need to dig across the net or mess with guide downloads. It actually modified the best way I work.
Alongside the best way, I additionally used a few apps that made issues even higher. Gitfox helped me keep on prime of my Git tasks with out the standard complications. DevUtils grew to become my go-to for fast duties like testing regex or formatting JSON. Each saved me time and made me really feel far more organized.
Should you’re curious, you could find each apps on Setapp. It’s a single subscription service that offers you entry to 260+ useful Mac and iOS instruments. There’s a 7-day free trial too, if you wish to take the apps for a spin earlier than you commit.
FAQs
What do I want Homebrew for?
You want Homebrew to put in, replace, handle, and uninstall numerous developer instruments related to your undertaking, together with Ruby, Node.js, and Python.
Can I set up Homebrew on macOS Monterey 12?
Sure, you may. It nonetheless works on macOS Monterey, however a number of the newer options won’t run as easily as they do on the most recent macOS variations. However for many on a regular basis instruments, you ought to be good to go.
Are there any good alternate options to Homebrew for Mac?
Some good alternate options to Homebrew for Mac are MacUpdater, MacPorts, ServBay, Nix Package deal Supervisor, Applite, Brewer X, and Mas CLI.
The best way to repair Homebrew cluttering on Mac?
Over time, Homebrew can go away behind previous variations of packages and unused dependencies, which take up area. To repair Homebrew cluttering on Mac, you may run brew cleanup
. This removes outdated variations of put in formulation. You too can use brew autoremove
to eliminate dependencies which are now not wanted.