• Home
  • DSA
  • Concept
  • Interview
  • Tips&Tricks
  • Tutorial Videos
  • Home
  • DSA
  • Concept
  • Interview
  • Tips&Tricks
  • Tutorial Videos
  • #News
  • #APPS
  • #Events
    • #WWDC
    • #I/O
    • #Ignite
  • #Let’s Talk
  • #Advertise

MyCodeTips mycodetips-newlogocopy1

  • Home
  • DSA
  • Concept
  • Interview
  • Tips&Tricks
  • Tutorial Videos
Programming, MAC-OS, No-Mouse

How to Uninstall Packages with Homebrew

How to Uninstall Packages with Homebrew

Uninstall Packages with Homebrew: The Homebrew command is the underlying package manager that installs all those UNIX and open-source utilities you might want. It’s the easiest way to install them on Mac OS X, just as it is on Linux. Like Homebrew Cask, it uses simple commands. To search for a utility

macOS Requirements

  1. A 64-bit Intel CPU
  2. macOS High Sierra (10.13) (or higher)
  3. Command Line Tools (CLT) for Xcode: xcode-select –install, developer.apple.com/downloads or Xcode
  4. A Bourne-compatible shell for installation (e.g. bash or zsh)

If you have installed Homebrew on a Mac to use as a package manager for various unix and command line utilities, you’ve probably also installed a handful of packages deemed useful to you. But what if you no longer need one, and you want to remove a particular Homebrew package?

It turns out that uninstalling packages / formula with Homebrew is very easy, and uninstalling and removing packages from Homebrew is just as easy as installing them in the first place.

we’re just talking about removing particular packages from Homebrew.

How to Uninstall & Remove Homebrew Packages

The proper way to remove a Homebrew package is with the uninstall or remove command.

The uninstall Homebrew package command looks like this:

brew uninstall packageName

The remove Homebrew package command looks like this:

brew remove packageName

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:

brew uninstall telnet

Or you can use the remove command for the same effect:

brew remove telnet

Removing a package from Homebrew is quick, as there is no need to download anything, it just deletes the Homebrew package from the Mac.

You can confirm the package was removed by trying to run the command again, or by checking where Homebrew packages are installed to and you will find the package you removed is no longer there.

Additional Homebrew Package Uninstall Options

There are two flags you can pass to the Homebrew uninstall command as well; –force and –ignore-dependencies.

The –force flag (or -f) will forcibly remove the package along with deleting all versions of that package / formula.

The –ignore-dependencies flag does just what it sounds like, it will ignore dependencies for the formula in question when uninstalling the designated package.

Managing Dependencies when Uninstalling Homebrew Packages
One thing to be mindful of when removing and uninstalling packages from Homebrew is that if the package being uninstalled has dependencies that are in use by another package or formula, then that may break it causing the secondary package to no longer work correctly. Perhaps the simplest way to prevent that is to use the optional –ignore-dependencies flag. For example:

brew uninstall --ignore-dependencies telnet

If you are not sure what dependencies exist with a particular Homebrew package, you can use the deps command to find that out:

brew deps packageName

For example, if you installed python3 on the Mac using the Homebrew approach, which has a fair amount of dependencies, running that command would look something like the following:

% brew deps python3
gdbm
openssl
readline
sqlite
xz

Since many other packages also use those dependencies, if you were to remove python3 you’d almost certainly want to issue the –ignore-dependencies flag. The same applies to node.js and npm, and many other popular Homebrew packages.

Do you know of any other methods or tips related to uninstalling Homebrew packages and formula? Share with us in the comments below!

Liked it? Take a second to support Ranjan on Patreon!
become a patron button
  • Click to share on Reddit (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • More
  • Click to share on Pocket (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
Written by Ranjan - 7869 Views
AUTHOR
Ranjan

Namaste, My name is Ranjan, I am a graduate from NIT Rourkela. This website is basically about of what i learnt from my years of experience as a software engineer on software development specifically on mobile application development, design patterns/architectures, its changing scenarios, security, troubleshooting, tools, tips&tricks and many more.

Next Post
Previous Post

Support us

mycodetips mycodetips
Follow us @ LinkedIn 2850+

Subscribe for updates

Join 8,213 other subscribers

Latest Posts

  • YT-Featured-solidprinciples
    SOLID Principles of Software Design
  • IOS 16 Features
    Latest features in IOS 16
  • r-language
    How can R language be used for data analysis?
  • wordpress-coding-blog
    Guide To WordPress Coding Standards
  • YT-Featured-Algorithm
    What is Algorithm?
  • Frameworks of IOS
    Frameworks of IOS – Part ( I )
  • NSFileManager or NSPathUtilities
    NSFileManager or NSPathUtilities in Objective-C
  • Passing data between view controllers in Objective-C
    Passing data between view controllers in Objective-C
  • structures-classes-enum
    Structures and Classes in swift !
  • control-system-swift
    Control Flow in Swift
whiteboard

Whiteboard(PRO)

whiteboard

Whiteboard(lite)

alphabets

Kids Alphabet

techlynk

Techlynk

techbyte

Do2Day

techbyte

Techbyte

  • #about
  • #myapps
  • #contact
  • #privacy
  • #Advertise
  • #Guestpost
  • #myQuestions

Android Android Studio API APP Programming Apps blogging CSS DATABASE dsa Features HTML HTML5 installation Interview Questions IOS iPhone javascript Mac objective-c OS Programming quicktips SDK SEO SQL swift Tips & Tricks Tools UI Web Wordpress Xcode

  • SOLID Principles of Software Design
  • Latest features in IOS 16
  • How can R language be used for data analysis?
  • Guide To WordPress Coding Standards
  • What is Algorithm?

©mycodetips.com