9

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 Answer 1

24

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.

5
  • 1
    if you want to remove all versions of a formulae then you could use - brew ls --full-name --formula | grep '^your/tap/' | xargs brew uninstall --force
    – kiran01bm
    Commented Jul 1, 2021 at 4:23
  • @bfontaine I know this is old, but what is '^your/tap'? To remove eq what exactly would go in here? grep bfontaine/utils?
    – todivefor
    Commented Dec 5, 2021 at 15:17
  • @todivefor ^your/tap would be ^bfontaine/utils if you want to remove everything from bfontaine/utils. To remove only bfontaine/utils/eq all you need to use is brew remove bfontaine/utils/eq.
    – bfontaine
    Commented Dec 5, 2021 at 16:38
  • @bfontaine Thank you for the reply. I guess I am confused as to the "^".
    – todivefor
    Commented Dec 6, 2021 at 17:25
  • @todivefor it’s to match at the beginning of the string, so that something-bfontaine/utils is not matched; only strings that start with bfontaine/utils are.
    – bfontaine
    Commented Dec 6, 2021 at 20:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.