Apple MacBook Air M2 resting on desk next to AirPods Pro and PS4 controller
Marcus Mears III / How-To Geek
Set up Homebrew on a Mac by operating the next command in Terminal:

/bin/bash -c "$(curl -fsSL up/HEAD/set"

You possibly can then run “brew set up” to put in software program.

Homebrew is a package deal supervisor for macOS that lets you set up software program utilizing the “brew” command on the command line. It’s simple to arrange and easy to make use of when you’re conversant in a couple of fundamental instructions.

The right way to Set up Brew on a Mac

To obtain Homebrew on a Mac, you simply must execute a couple of instructions in a Terminal window. Homebrew works on each Apple Silicon (M1, M2, and so forth) Mac fashions in addition to older Intel-based machines.

To get began, launch Terminal (use Highlight or discover it beneath Functions > Utilities), then paste (or kind) the next adopted by the Enter key:

/bin/bash -c "$(curl -fsSL up/HEAD/set"

You’ll be prompted to your admin password. Sort it after which hit Enter to proceed.

Enter password to install Homebrew on macOS

Subsequent, you’ll be notified of what’s about to be put in as a part of the Homebrew setup course of. This contains the Xcode Command Line Instruments, which will probably be put in for you alongside different important Homebrew elements. Hit Enter to begin putting in Homebrew on macOS.

Hit Enter to install Homebrew on Mac

Now, you should watch for the assorted packages to obtain and set up. How lengthy this takes largely depends upon your web velocity, however the entire thing ought to be over in round 5 minutes or so. As soon as the set up is full, you’ll be prompted to run two extra instructions.

Finish setting up Homebrew on macOS

First, run the next two instructions so as to add Homebrew to your PATH:

echo 'eval $(/decide/homebrew/bin/brew shellenv)' >> /Customers/$USER/.zprofile
eval $(/decide/homebrew/bin/brew shellenv)

Should you don’t run these two instructions, you’ll get a “command not discovered: brew” when making an attempt to run Homebrew instructions.

You possibly can run brew replace to ensure your checklist of accessible packages is updated. Lastly, run the brew physician command to ensure every little thing is working as marketed. Homebrew will checklist any points and the instructions it’s worthwhile to run to repair them.

The right way to Use Homebrew on a Mac

Use the “brew set up title command to put in purposes in your Mac, changing “title” with the title of the appliance you need to set up. Homebrew can set up each graphical purposes (referred to as casks) and open-source command-line instruments (referred to as formulae). For instance, to put in Firefox, you’d run:

brew set up firefox

Should you’re in search of a specific piece of software program, you possibly can seek for it utilizing the brew search command:

brew search google

Yow will discover an inventory of all formulae and casks accessible on the Homebrew Formulae web site.

Using the "brew search" command to find casks and formulae

You possibly can restrict your instructions to only casks or formulae utilizing the --cask or --formula choices, for instance:

brew search --formula apt

Yow will discover an inventory of packages you might have put in utilizing the brew checklist command. When you’ve discovered a package deal, you will get extra details about what it does utilizing the brew data command, together with an outline, any related .APP recordsdata, the mission homepage, and the present model:

brew data unofficial-wineskin

By default, Homebrew makes use of solely the core listing of formulae, casks, and exterior instructions. You’ll have to put in some purposes by “tapping” into one other repistory utilizing the brew faucet command. Working this command by itself will checklist all presently tapped directories.

Using the "brew tap" command to list tapped directories

To take away an app you’ve put in utilizing Homebrew, run the brew take away command (with or with out --formula or --cask choices), for instance:

brew take away firefox

There are much more Homebrew instructions and choices that you should utilize, however these are the fundamentals. For a full checklist of instructions and extra choices try the Homebrew Documentation.

Why Homebrew Is So Helpful on a Mac

Homebrew makes it potential to put in purposes with a single command, proper from macOS Terminal. This removes the necessity to seek for an app web site, discover a obtain hyperlink, obtain a .DMG or .PKG file, drag the .APP file into your Functions folder or run the .PKG, and eliminate no matter’s left over.

Utilizing brew search yow will discover purposes primarily based purely on their title and set up them in a flash. It’s additionally simple to maintain these apps updated, merely run the brew improve command to replace every little thing, or restrict the command to a particular cask or formulation for instance:

brew improve firefox

For open-source utilities, Homebrew is an all-in-one software that may discover, obtain, set up, and keep every little thing for you. It installs every other dependencies you might want for a utility to work, a tedious course of that may in any other case require step-by-step set up.

A number of the most helpful utilities (and their dependencies) may be put in in mere seconds with Homebrew, together with Docker (docker), Node.js (node), Python (pyenv), Java (java), PostgreSQL ([email protected]) and Npm (npm).

Searching for docker with brew on a Mac.

Continuously Requested Questions

What Is Homebrew on a Mac?

Homebrew is a free package deal supervisor that lets you discover, set up, and keep open-source utilities and graphical purposes utilizing easy textual content instructions. The appliance may be put in and used solely by way of the Terminal utility constructed into macOS.

The right way to Uninstall Homebrew on a Mac

You possibly can take away Homebrew by downloading and operating the uninstall script with the next command:

/bin/bash -c "$(curl -fsSL up/HEAD/"

The right way to Add Homebrew to the Path on a Mac

That is coated within the ultimate a part of the Homebrew setup course of. When you’ve put in Homebrew the installer ought to immediate you to run two extra instructions, the primary is:

echo 'eval $(/decide/homebrew/bin/brew shellenv)' >> /Customers/$USER/.zprofile

And the second is:

eval $(/decide/homebrew/bin/brew shellenv)

The right way to Repair “brew command not discovered” on macOS

Should you encounter a “command not discovered” error whereas trying to run brew instructions you’ve both not obtained Homebrew put in otherwise you didn’t run the ultimate two instructions as prompted through the setup course of.

Don’t keep in mind putting in Homebrew? Run the installer utilizing the next command in Terminal:

/bin/bash -c "$(curl -fsSL up/HEAD/set"

In any other case, run the ultimate two instructions in order that macOS acknowledges the brew command while you try to run it. The primary is:

echo 'eval $(/decide/homebrew/bin/brew shellenv)' >> /Customers/$USER/.zprofile

And the second is:

eval $(/decide/homebrew/bin/brew shellenv)

Why Don’t Identified Homebrew Casks or Components Present Up After I Search?

Should you discover formulae or casks within the Homebrew Formulae browser that received’t present up while you run the brew search command, you may must faucet the core package deal checklist once more. To do that, first run:

rm -rf "/decide/homebrew/Library/Faucets/homebrew/homebrew-core"

Now faucet the core once more manually utilizing:

brew faucet homebrew/core

Don’t neglect to run brew physician if issues aren’t working correctly for extra steerage.

The place Is Homebrew Put in on a Mac?

Homebrew is put in within the /decide/homebrew listing in your Macintosh HD drive. You will get there by launching Finder adopted by Go > Go to Folder (Command+Shift+G) and typing “/decide/homebrew” adopted by Enter.

To seek out out the place a particular package deal is put in, use the brew data command, for instance:

brew data firefox

Can I Set up Homebrew With out Xcode?

You don’t want the total Xcode package deal to put in Homebrew, simply the Xcode Command Line Instruments. These ought to be put in while you try to put in Homebrew. Alternatively, you possibly can set up them your self utilizing the next Terminal command:

xcode-select --install

You Can All the time Set up Mac Apps the Previous Customary Method

Homebrew is way from the one strategy to set up Mac software program. Installing software on a Mac is easy, whether or not you’re utilizing the Mac App Retailer, a downloaded .DMG file, or a .PKG installer. When you’ve tried out an app, you possibly can remove it using the Trash or a third-party app.

Source link