On the off chance that you have introduced Homebrew on a Mac to use as a bundle director for different Unix and order line utilities, you’ve most likely likewise introduced a bunch of bundles esteemed helpful to you. In any case, consider the possibility that you never again need one, and you need to expel a specific Homebrew bundle.
For reasons unknown, uninstalling bundles/recipe with Homebrew is simple, and uninstalling and expelling bundles from Homebrew is similarly as simple as introducing them in any case.
Honestly, we’re not looking at uninstalling Homebrew itself, we’re simply looking at expelling specific bundles from Homebrew.
How to Uninstall & Remove Homebrew Packages
The best possible approach to evacuate a Homebrew bundle is with the uninstall or expel order.
The uninstall Homebrew bundle direction resembles this:
brew uninstall packageName
The evacuate Homebrew bundle order resembles this:
brew remove packageName
As you may have speculated at this point, the evacuate and uninstall directions are actually the equivalent, and get a similar outcome; the expulsion of the Homebrew bundle.
For instance, to expel and uninstall Telnet (expecting you introduced telnet on the Mac with Homebrew in any case), you would utilize the accompanying order string:
brew uninstall telnet
Or on the other hand you can utilize the evacuate order for a similar impact:
brew remove telnet
Expelling a bundle from Homebrew is brisk, as there is no compelling reason to download anything, it just erases the Homebrew bundle from the Mac.
You can affirm the bundle was evacuated by attempting to run the direction once more, or by checking where Homebrew bundles are introduced to and you will discover the bundle you expelled is no longer there.
Additional Homebrew Package Uninstall Options
There are two banners you can go to the Homebrew uninstall direction also; – power and – disregard conditions.
The – power banner (or – f) will persuasively expel the bundle alongside erasing all variants of that bundle/recipe.
The – disregard conditions banner does exactly what it seems like, it will overlook conditions for the recipe being referred to when uninstalling the assigned bundle.
Managing Dependencies when Uninstalling Homebrew Packages
One thing to be aware of when expelling and uninstalling bundles from Homebrew is that if the bundle being uninstalled has conditions that are being used by another bundle or equation, at that point that may break it making the optional bundle never again work accurately. Maybe the least complex approach to avert that is to utilize the discretionary – disregard conditions banner. For example:
brew uninstall --ignore-dependencies telnet
In the event that you don’t know what conditions exist with a specific Homebrew bundle, you can utilize the depth direction to locate that out:
brew deps packageName
For instance, in the event that you introduced python3 on the Mac utilizing the Homebrew approach, which has a decent lot of conditions, running that order would look something like the accompanying:
% brew deps python3
Since numerous different bundles likewise utilize those conditions, if you somehow happened to evacuate python3 you’d more likely than not have any desire to issue the – overlook conditions banner. The equivalent applies to node.js and npm, and numerous other prominent Homebrew bundles.