DevOps

How to Install Homebrew on Mac? {Quick Steps}

Introduction

Installing open-source and free programs from your terminal is possible with Homebrew, a package manager for macOS. For setting up development tools including Python, Ruby, Node.js, and many more, utilize Homebrew.

Discover how to install and make use of Homebrew on macOS in the following tutorial.

How To Install Homebrew on Mac?

How To Install Homebrew on Mac?

The step-by-step instructions shown below will help you install and use the Homebrew setup script for your Mac.

Get the Xcode Command Line Tools

Homebrew requires specific tools from Xcode, a unified development platform for MacOS.

For example, running and setting up PuTTY, a Mac-based telnet or SSH client, could require the use of Xcode.

Installing just the Xcode command line tools via the App Store will save you space because you no longer require the complete 10GB Xcode package.

Take the following actions:

1. For a listing of all the utilities, choose Utilities on the Finder’s Go menu.

2. Find the Terminal application and start it.

3. Use the following command within the terminal for installing the Xcode command-line tools:

xcode-select --install

4. To continue with the installation process, select Install once prompted.

5. The script shows the terms of the Xcode Licence Agreement. To proceed with the process of installation after accepting all of the conditions, hit Agree.

Install Homebrew

Take the steps listed below for setting up Homebrew following installing the Xcode command-line tools.

1. Get the installation script as follows:

If you’re on macOS High Sierra, Sierra, El Capitan, and previous versions, you should run:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Individuals operating Big Sur, Mojave, as well as Catalina carry out:

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

2. When asked, provide your administrator’s password, followed by hitting Return to proceed. Watch for the process of downloading to complete.

The installation script informs you of the modifications that will be made to your computer.

3. Hit Return to set up Homebrew. This might require just a few moments for the installation to complete, so keep an eye out for the message “Installation successful.”

Turn Off Analytics

Homebrew automatically gathers some system data and relays it to the program’s creators. It gathers the following data:

  • Homebrew’s user agent.
  • It uses Google Analytics.
  • Tracking ID along with user ID for Homebrew Analytics on Mac.
  • Events like the category for Homebrew installs.

Stop analytic data gathering by running:

  • brew analytics off

Perform the following command to determine the current state of the analytic gathering process shortly after disabling analytics:

  • brew analytics

You can tell whether the analytics has been turned on or disabled by looking at the results.

Also Read: How to Install PIP on Mac? (Step By Step Guide)

Download, Update, and Uninstall Packages

Download, Update, and Uninstall Packages

Package installation:

By applying the syntax shown below, you can set up packages with Homebrew on Mac:

brew install [package name]

To provide a graphical depiction of a directory tree, for instance, download the tree command by typing

brew install tree

It also installs the tree command while installing the Homebrew package on Mac list of items.

Package updates:

To guarantee you constantly have the most recent options, you need to routinely update both the package manager and the packages loaded and install Homebrew on Mac.

Execute the following command to gain insight into the list of packages that require updating:

brew outdated

For updating a particular package, utilize the syntax shown below:

brew update [package name]

Execute the following command to see if you’re using the most recent Homebrew edition:

brew update

The report indicates that everything appears to be current because Homebrew has just been installed.

Package removal:

The program you want to delete is occasionally dependent on the applications you continue running. Use the syntax provided below to confirm:

brew deps [package name]

Make use of this syntax to remove a package irrespective of any software dependencies:

brew uninstall --ignore-dependencies [package name]

Delete the following code from your system when you no longer require a piece of software that you’ve in the past installed Homebrew on Mac:

brew uninstall [package name]

Recommended: How to Update Node js Version on Windows, Ubuntu, and Mac?

The Best Way to Remove Homebrew

The Best Way to Remove Homebrew

Pay attention to the instructions listed below to remove Homebrew from your Mac:

1. Execute the following command.

From macOS, Big Sur, Catalina, as well as Mojave:

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

From macOS High Sierra, Sierra, El Capitan, as well as earlier:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

2. Before removing any Homebrew files, the system tells you and requests your approval. You can remove Homebrew from your computer by typing y and pressing Return.

Conclusion

Right now, you have access to the programming languages, command-line resources, and additional utilities required for software development using Homebrew.

You can set up and install Homebrew on Mac. You should get Homebrew set up on your system once you finish the instructions in this article. There are many advantages of utilizing homebrew. There are hundreds of thousands of command-line-based tools readily accessible, a large number of apps not found in the App Store, as well as contains a broad range of software packages in one location.

Arpit Saini

He is the Chief Technology Officer at Hostbillo Hosting Solution and also follows a passion to break complex tech topics into practical and easy-to-understand articles. He loves to write about Web Hosting, Software, Virtualization, Cloud Computing, and much more.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *