Search code examples
macosinstallationhomebrewhomebrew-cask

How to deal with existing installations with Homebrew?


Before installing Homebrew, I had existing installations on my MacBook. For instance, I installed Google Chrome and Node.js as people normally do - by visiting their websites and downloading the .dmg/.pkg files.

Whereas, with Homebrew I would have ran

brew cask install google-chrome
brew install node

To integrate these applications with Homebrew, would I need to uninstall them and reinstall through Homebrew? Can Homebrew detect these existing installations? Is there an advantage to using a package manager?

(My thoughts are migrating them would allow me use brew update to maintain them.)


Solution

  • To integrate these applications with Homebrew, would I need to uninstall them and reinstall through Homebrew?

    Yes.

    Can Homebrew detect these existing installations?

    Homebrew can’t manage applications that were installed outside of it. It can detect some installations—for example if Python is installed Homebrew won’t force you to install it again if a formula depends on it—but can’t act on them.

    Is there an advantage to using a package manager?

    It depends.

    • If you already use GUI apps like Google Chrome, uninstalling them then reinstalling with brew cask won’t change anything; brew cask installs stuff but you have to update it yourself after that.
    • If you don’t already have these apps, using a package manager is faster an easier than going on each website, download the .dmgs, drag the .apps. It’s more automatable and you can use brew-bundle for a faster setup when you get a new machine.
    • Regarding classic Homebrew formulae (i.e. stuff installed with brew install instead of brew cask install) Homebrew will update things for you so depending on your usage it might make sense to uninstall then reinstall through Homebrew. In any case brew install foo is always faster than searching the Web for the instructions to install foo, and most popular formulae are already pre-compiled for the last 3 major OS X releases.