Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove everything from a Homebrew tap?

Tags:

macos

homebrew

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?

like image 646
patpat Avatar asked Nov 17 '17 17:11

patpat


People also ask

How do you remove taps from Homebrew?

The brew tap command You can install and uninstall them with brew [un]install , and the formulae are automatically updated when you run brew update .

What is brew untap?

brew untap user/repo [user/repo user/repo ...] removes the given taps. The repositories are deleted and brew will no longer be aware of their formulae. brew untap can handle multiple removals at once.

How do I remove a Homebrew package?

The proper way to remove a Homebrew package is with the uninstall or remove command. The uninstall Homebrew package command looks like this: The remove Homebrew package command looks like this: As you may have guessed by now, the remove and uninstall commands are exactly the same, and get the same result; the removal of the Homebrew package.

What is brew tap username/homebrew-foobar?

That is, brew tap username/foobar can be used as a shortcut for the long version: brew tap username/homebrew-foobar. brew will automatically add back the ‘homebrew-‘ prefix whenever it’s necessary. If your tap contains a formula that is also present in homebrew/core, that’s fine, but it means that you must install it explicitly by default.

Can you leave out the ‘Homebrew-’ prefix in Brew?

When you use brew tap on the command line, however, you can leave out the ‘homebrew-‘ prefix in commands. That is, brew tap username/foobar can be used as a shortcut for the long version: brew tap username/homebrew-foobar. brew will automatically add back the ‘homebrew-‘ prefix whenever it’s necessary.

What is the difference between remove and uninstall homebrew on Mac?

As you may have guessed by now, the remove and uninstall commands are exactly the same, and get the same result; the removal of the Homebrew package. For example, to remove and uninstall Telnet (assuming you installed telnet on the Mac with Homebrew anyway), you would use the following command string:


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.

like image 172
bfontaine Avatar answered Oct 03 '22 16:10

bfontaine