How to Uninstall Packages with Homebrew?

When you install Homebrew on your Mac as a package manager, you will experiment by installing several packages that you find useful.

But what happens when you don’t need a specific Homebrew package is that it is just taking up the space. So, you can uninstall packages with Homebrew with a simple command to make some space and clean up the computer.

Removing packages with Homebrew is easy. In fact, uninstalling and deleting packages from Homebrew is as simple as installing a package.

How to Uninstall Packages with Homebrew

Here is how you can uninstall packages with Homebrew that you previously installed.

1. Press command + spacebar on your keyboard to open the spotlight search.

uninstall packages with Homebrew

2. Search for Terminal and open the first result.

uninstall packages with Homebrew

3. Type in the following command followed by Homebrew package name.

Here wget is the package name so you can replace it with the one you want to uninstall.

brew uninstall wget
remove packages with Homebrew

So, the homebrew package is removed, but some of the files still remain. Now, we will remove them.

4. First, let us list the remaining files with the following command and press enter.

brew list

Then, you will see the remaining files as you can see in the image above.

remove packages with Homebrew

5. After that, type the following command and press enter.

brew autoremove
uninstall packages with Homebrew

This will remove all the remaining homebrew package dependencies and provide you with more space on the Mac PC.

Now, if you want to go overboard and remove outdated formulas and caskets, then use the following command.

brew cleanup -s
uninstall packages with Homebrew

Uninstall Package with Homebrew without removing dependences

Sometimes, dependencies are used by multiple packages. So, removing them will make the other package unusable. Use this command instead while uninstalling to ignore the dependencies.

It ignores dependencies with the Homebrew package, which are in use by other packages.brew uninstall –ignoredependencies package name
Find out the dependencies with the package before uninstalling thembrew deps package name

Also ReadRemove DNS cache on macOS

Remove Packages with Homebrew

So this is how you can uninstall packages with Homebrew. You can remove it using the uninstall command and be done with the process.

But if you want to remove every related file and cache, then do remember to use the autoremove command.

Subscribe to our newsletter

To be updated with all the latest news

Amaan Rizwan
Amaan Rizwan
Anything and everything because titles should not define us. A non-fiction lover. Khalid Hosseini and Ruskin Bond fan. Aspiring to be better than yesterday.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Subscribe to our newsletter

To be updated with all the latest news

Read More

Suggested Post