Homebrew is a package manager for Mac OS. It lets you download binaries, packages, and applications with a single command.
20th Nov 2019
In this article, I want to explain how to use Homebrew.
Installing Homebrew
You can install Homebrew with this command: How to find library on mac air pro.
Jun 15, 2020. In this tutorial we will learn how to install Homebrew(Homebrew define themselves as 'The missing package manager for OS X'.
Updating Homebrew
To update homebrew, you use
brew update . This updates Homebrew to its latest version. (You always want Homebrew to be at the latest version before downloading anything).
Installing a package![]()
Each package is called a formula. To install a formula, you use the install command.
For example, to install Node with Homebrew, you use this:
If you’re feeling bored, here’s a list of everything you can install with Homebrew. You can also find a list of formulae I use in my Dotfiles repository. (Unsure what dotfiles are? Read this).
Upgrade a package
To upgrade one package, you use this:
To upgrade all packages, you use
brew upgrade without specifying any formulas.
Downgrade a package
Let’s say you have the latest version of Node installed. You want to downgrade to a previous version.
First, you need to use
brew search https://renewunity258.weebly.com/blog/family-feud-mac-download-free. to find the package.
You want to find the possible versions to download from the results. In this example, we can install node v8 or v10.
Install the version you want to use. In this case, lets install Node 10.
Next, we need to unlink our current node version.
Then, we need to link the version we installed. In this case, it’s [email protected] To link a formula, you use the
link command.
Sometimes, (like in this case), you need to use
--force to link the formula.
Now if you run
node -v , you should see that Node v10 is installed.
Notice its Node is now v10.16.3. Unfortunately, with Homebrew, we don’t get to use Semantic Versioning with Homebrew, so you can’t install specific versions. You can only perform major version upgrade/downgrades.
(But this is enough 99% of the time).
To change back to the latest node version, you repeat the
unlink and link steps:
Here’s the funny thing about Node + Homebrew.
When you run
brew `link node , Homebrew doesn’t install npm for you. So if you want to install any Node version, make sure you run install or reinstall instead.
I really shouldn’t have used Node as an example ?♂️… But I still decided to use it because nobody talked about the npm problem I mentioned above.
Deleting a package
To remove a package, you use the uninstall command.
Brew cleanup
Once in a while, you might want to run
brew cleanup to remove state and outdated downloads from your computer. (Free up space! ?).
Homebrew manages a list of formulae in a place called
homebrew/core . When you install files, you install from this list.
“Core” here means folks at Homebrew maintain the formulae list.
Other people can let you install their stuff with Homebrew as well. To do this, they need to create a formulae list. Then, they have to publish this list.
brew tap lets you add a third-party formulae list into Homebrew. Once you added the formulae list, you can use brew install to install the formula.
For example, to install MongoDB with Homebrew, you need to tap into
mongodb/brew .
Mac Homebrew List
Then, you install MongoDB like this:
![]()
Homebrew contains another formulae list called
homebrew/cask . This list lets you install GUI applications like Google Chrome, Safari, Atom, and others.
To install a cask, you use the
brew cask install command.
That’s it!
If you enjoyed this article, please tell a friend about it! Share it on Twitter. If you spot a typo, I’d appreciate if you can correct it on GitHub. Thank you!
Download Homebrew For Mac
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |