How to install and uninstall HomeBrew on your Mac

If you’re the kind of Macs user who spends a lot of time using Terminal and need to install other command line tools like cask, htop, or wget, at some point you’ll want to install the Homebrew package manager, which makes it easier to install them. Here’s how to install and how to uninstall Homebrew.

What is Homebrew?

Homebrew is an open-source package management system that simplifies the installation of ‘home-brewed’ software on macOS. That is, the large body of UNIX and open source software available for download.  It’s written in Ruby and consists of a git repository, which allows updated repositories to be downloaded from GitHub. 

Homebrew downloads the files necessary to install and run a piece of software and then compiles them into binaries for installation.

Why would I install Homebrew?

If you’re interested in installing UNIX tools that don’t come with their own installers for macOS, Homebrew makes finding, creating and configuring installation packages much easier than doing it manually.

How to install Homebrew

In addition to a Mac with Mac OS X or macOS installed and a little knowledge of using bash or zsh, you will need to install Command Line Tools before attempting to install Homebrew. Here’s how to do that.

  1. Go to Applications>Utilities and double-click Terminal to launch it.
  2. Type this command: `xcode-select —-install`
  3. You will see a pop-up window telling you that ‘xcode-select’ requires access to command line developer tools and asking for your permission got install them. Press Install.
  4. Wait for the installation to finish.

Once Command Line Tools has installed, you can go ahead and install Homebrew like this:

  1. Launch Terminal again.
  2. Type in the following command: `/use/bin/ruby -e “$(curl -fsSL”`
  3. Press Return and you’ll see a number of lines explaining telling you what the script will install and where it will install it.
  4. Hit Return again.
  5. Type in your admin password.
  6. When installation is complete – which could be a while, depending on your Mac and internet connection speed – you will see a message that says ‘installation successful’.

Once you see that message, you can start to install software packages using Homebrew. First, though, it might be worth reading the documentation. To do that, use this command in Terminal:

`brew help`

To install packages, use the following syntax:

`brew install [package name]`

So, to install cask, for example, the command would be:

`brew install cask`

How to uninstall Homebrew on your Mac

There are a number of ways to uninstall Homebrew on your Mac. One method is to use read the documentation and follow the instructions there to manually uninstall. Use this command:

`./uninstall --help`

Another method is to use a ruby curl command to download the uninstall script from GitHub and execute it. To do that, use this command:

`ruby -e “$(curl -fsSL”`

If you don’t want to use curl to execute a script downloaded from the internet, you can download it manually, review it, and then execute it. The script can be downloaded here: https://raw.githubusercontent.... Once you’ve downloaded it, save it as a text document and then run the uninstall using that.

The easiest way to uninstall anything on your Mac

If all that seems like a lot of hassle just to uninstall Homebrew, you’re probably looking for an easier way. Did you know there is a much easier way to uninstall any app on your Mac, and that it doesn’t just but the app package in the Trash, but tracks down all of its associated files and gets rid of those too?

CleanMyMac X does just that, and it’s recommended by several well-known Mac websites and blogs as the easiest way to uninstall apps on the Mac. It’s particularly good if you need to uninstall several apps simultaneously. Here’s how to use it.

All apps selected in the Uninstaller module of CMMX

  1. Install, and launch CleanMyMac X — a link to download free edition.
  2. Choose the Uninstaller utility in the sidebar.
  3. Check the box next to the app or apps you want to uninstall.
  4. Press Uninstall.

All the apps you chose will be uninstalled, leaving no trace of them behind. CleanMyMac X can also help when you’re having trouble with apps that are misbehaving. Before you uninstall a troublesome app, try using CleanMyMac X to reset it. 

Resetting apps: A feature you’ve missed all along

Resetting an app removes some if its settings and preferences files but leaves the app intact. The next time you launch it, it behaves as if you had just launched it for the first time after downloading it. That may solve performance issues. Here’s how to do it.

  1. Launch CleanMyMac X.
  2. Choose the Uninstaller tool.
  3. Locate the app in the list that’s having problems.
  4. Click in the drop down menu to the right of the app’s name, where it currently says ‘Uninstall’ and select ‘Reset’.
  5. You will see that the big Uninstall button at the bottom of the window has changed to Reset. Press it.
  6. The app will now reset and behave as if it was newly installed.
Safari reset selected in the Uninstaller module in CMMX

The app is notarized by Apple and available for a free download here.

If you chose to uninstall Homebrew by downloading the uninstall script manually and saving it as a text file, rather than running the curl script, because your conscious of possible security issues, you’ll want to check out CleanMyMac’s malware tool. It scans you Mac for known malware, and if it finds any offers to remove it.

Homebrew is a very useful tool for anyone who wants to run open-source Unix software on their Mac, but wants a simple way to install it. You’ll have to be comfortable using Terminal in order to install it, but that shouldn’t be an issue if you’re the type of Mac user who’s interested in open source Unix tools.

Laptop with CleanMyMac
CleanMyMac X

Your Mac. As good as new.