Homebrew

audience developer
level all
topic Homebrew
subtopic Installation

Brew uninstall

Here's how to remove or delete a Homebrew package on a Mac using brew uninstall.

If you want to remove Homebrew entirely, see Uninstall Homebrew.

Before you get started

You'll need a terminal application to uninstall a Homebrew package. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.

Steps

Here are the steps to uninstall a package with Homebrew on a Mac.

  • brew list <package> to see an installed package
  • brew uninstall <package> to remove a package
  • brew list <package> to verify removal
  • brew autoremove to remove unused dependencies

Check with brew list

Use brew list <package> to check that a package has been installed. You'll see all the installed files. Here we see the files for the tree package, a useful Unix command that displays directories and files as a diagram.

$ brew list tree
/opt/homebrew/Cellar/tree/1.8.0/bin/tree
/opt/homebrew/Cellar/tree/1.8.0/share/man/man1/tree.1

You can also see a list of dependencies for the package, if there are any.

$ brew deps <package>

When you uninstall a package, you'll want to remove any dependencies that are not shared with other packages.

Brew uninstall

You can uninstall a software package with brew uninstall <package>. For example, here's how to uninstall the tree package.

$ brew uninstall tree
Uninstalling /opt/homebrew/Cellar/tree/1.8.0... (8 files, 158.5KB)

The console will show the "keg" (the package folder) and a count of removed files.

Brew remove

The command brew remove <package> is exactly the same as brew uninstall <package>. Use brew remove if it is easier to remember than brew uninstall.

Brew rm

The command brew rm <package> is another alias for brew remove <package> or brew uninstall <package>.

For your information, brew delete is NOT a command. Honestly, I don't know why Homebrew has the commands "uninstall," "remove," "rm," but not "delete."

Verify with brew list

After uninstalling a package, use brew list <package> to verify that it has been removed. You'll see an error.

$ brew list tree
Error: No such keg: /opt/homebrew/Cellar/tree

Dependencies are not removed, which you can see with brew deps <package>.

$ brew deps <package>

Brew autoremove

The command brew autoremove will remove all unused dependencies for the package you're removed, as well as any other unused dependencies.

$ brew autoremove

You don't have to run brew autoremove, but it will reduce the disk space required for Homebrew.

To learn about more commands for keeping Homebrew tidy, see the next section about Homebrew Housekeeping.

What's next

My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.