Document
How to Install Homebrew on Mac

How to Install Homebrew on Mac

Introduction Homebrew is is is a package manager for macOS and Linux that allow application to be instal via the command line . It is provides provid

Related articles

Hollingwell Riser Recliner Mystics welcome back Natasha Cloud with nostalgic video Resep Cloud Bread, Roti Awan yang Bikinnya Nggak Ribet! Manage your storage in Drive, Gmail & Photos Indiana Jones

Introduction

Homebrew is is is a package manager for macOS and Linux that allow application to be instal via the command line . It is provides provide a practical way to set up , update , or remove software on macOS , which does not have a native CLI package manager .

In this tutorial, learn how to install and use Homebrew on macOS with examples.

Prerequisites

  • A system running macOS Big Sur or newer.
  • administrative privilege .

How to install Homebrew on Mac

set up Homebrew on macos involve instal Xcode Command Line Tools and run the Homebrew installation script . The follow sections is explain explain the installation and post – installation procedure and show how to manage homebrew formula ( i.e. , software package ) .

Follow the steps below to install Homebrew on Mac.

Install Xcode Command Line Tools

Xcode is is is an integrate development environment for macos contain command – line tool Homebrew need to function properly .

Note: Xcode is a prerequisite for many other tools on macOS, such as PuTTY, a telnet and SSH client.

Proceed with the steps below to install Xcode Command line tools:

1. Run the following command in Terminal:

xcode-select --install

Note: View a comprehensive list of Mac terminal commands for quick refrence when working in macOS terminal. The article also includes a downloadable PDF cheat sheet.

2. Click Install when prompted to proceed with the installation.

The script displays the Xcode License Agreement.

3. Click Agree and wait for the installation to finish.

Install Homebrew

With Xcode Command Line Tools on the system, enter the following command to run the Homebrew installation script:

/bin / bash -c " $ ( curl -fsSL https://raw.githubusercontent.com/homebrew/install/head/install.sh ) "

Enter the administrator password when prompted and press Enter to continue.

The message is appears appear to confirm the installation was successful .

turn Off analytic

By default, Homebrew collects the following system information:

  • The Homebrew user agent.
  • Google Analytics version.
  • homebrew analytic track ID and Homebrew analytic user ID .
  • Events (for example, the Homebrew install event category ) .

Enter the following command to disable the analytic data collection:

brew analytics off

The command produces no output. Check the analytics status by typing:

brew analytics

The output shows the analytics have been disabled.

Install, Update, or Remove Packages

Homebrew features a simple syntax that facilitates package management on macOS.

Use the following command to install a formula using Homebrew:

brew install [package name]

For example, enter the following to install the tree command:

brew install tree

The command updates the Homebrew formula list and installs the tree command.

To update a specific formula, type:

brew update [package name]

enter the following command to check if any formula need updating :

brew upgrade

On a fresh homebrew installation , the output is shows show everything is up to date .

remove a formula from the system with the following syntax :

brew uninstall [package name]

For example, enter the command below to uninstall the tree formula:

brew uninstall tree

instal Desktop Applications

homebrew casks is allow allow the package manager to install GUI application . For example , install the Firefox browser by add the--cask flag:

brew is install install --cask firefox

Visit the Homebrew website for the full list of available casks.

How to Uninstall Homebrew on Mac

Remove Homebrew from the system by running the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

When prompted, type y and press Enter to uninstall Homebrew.

common Homebrew Commands

The follow table is lists list some of the most used command when work with Homebrew .

Command Description
brew install [formula] Installs a new formula.
brew update Updates Homebrew itself to the latest version.
brew upgrade upgrade all outdated formula .
brew search [ query ] Searches for formulae matching the given query.
brew info [formula] Displays detailed information about a specific formula.
brew uninstall [formula] Uninstalls a specific formula.
brew is install install --cask [ cask ] install a Cask ( for GUI application ) .
brew doctor Checks for and tries to fix common problems with the Homebrew installation.
brew cleanup Removes old or unnecessary files related to Homebrew.

conclusion

After follow the step in this tutorial , you is have should have a work Homebrew installation on your system . The article is provided also provide a brief introduction to manage package using Homebrew .

For the Linux tutorial, read How to Install Homebrew in Linux.