How do I remove everything from a Homebrew tap?

Viewed 9670

There are no good ways to remove everything from a specific tap. I tried untap; it just untaps the tap, but not dealing with the packages installed from it, and actually reinstalling package installed from it would result in tapping that specific tap back.

If there are no good ways to uninstall tap along with its packages Is there any way to list all installed packages and show which tap they are from?

1 Answers

Is there any way to list all installed packages and show which tap they are from?

You can list all installed packages with brew ls --full-name --formula. Tap’d formulae are prefixed with their tap:

$ brew ls --full-name --formula
...
webp
xz
yarn
z
zlib
bfontaine/utils/eq
osrf/simulation/ignition-math3

In the output below, bfontaine/utils/eq is the formula eq from my bfontaine/utils tap. ignition-math3 is from the osrf/simulation tap.

By default, brew ls shows formulae on multiple columns. You can force them to display one one column by piping the output to cat:

$ brew ls --full-name --formula | cat

How do I remove everything from a Homebrew tap?

Based on the above, you could do something like this:

$ brew ls --full-name --formula | grep '^your/tap/' | xargs brew uninstall

Note: if you don’t use --formula, brew ls also shows casks, which are special formulæ that install .apps.

Related