Sunday, October 30, 2016

Why Homebrew is awesome

   Homebrew is a package manager for Mac OS. Similar to yum on Centos and apt-get on Ubuntu you can search repositories for specific software and install it on your machine using brew install package_name.
   Now, this post is about a cool feature of Homebrew I didn't know before. You can install full fledged apps that typically are distributed in a form of .dmg files right from Terminal using Homebrew.
   For example you can install heavyweight apps like IntelliJ and RubyMine by JetBrains, Atom, Chrome browser etc ... without ever leaving the Terminal, opening the browser to look for installers.
   The only thing you need to do is to specify cask option in brew command.
For example, if we want to install IntelliJ just run  brew cask install Caskroom/cask/intellij-idea
   Isn't that cool! No more looking and googling around for app's distributions and how to install it.
   Installing java is a good example. Instead of going to Oracle website, figuring out which link to press, which type of package you need for your specific need. With Homebrew you just type brew search java and once you settled on what package you like you go brew cask install Caskroom/cask/java... without ever leaving the Terminal window.
   Now, how do you know when you need to use cask option?
   Let's talk about brew search some_string. This command is used to search for available packages which have some_string in them. If the package you like to install is having cask in it - you need to use cask option.

  So let's go over an example - I want to install Chrome. Here's how it would look like:
  1. search for available packages by running brew search chrome

    seems like we want to use package Caskroom/cask/google-chrome
  2. install the package by running brew cask install Caskroom/cask/google-chrome
That's it! Chrome should be installed and available in your Applications folder.