Installing applications on Mac like Linux with Homebrew

Homebrew is a package manager something similar that you can found on Linux distributions. If you see in my previous posts, I used Homebrew to install my applications, and I used it because is easy to use and keeps applications updated.
If you don't have Homebrew installed it is easy to install, you can see the installation instructions on its website.
Install Homebrew
You only need open the terminal and insert this command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Wait couple minutes the script will install Homebrew for your user.
Install applications with Homebrew
You can install applications with the install
option, for example for install wget
:
brew install wget
And that's it now your system has wget
installed from Homebrew.
Adding repositories to homebrew
Like a Linux package manager in Homebrew is possible to add repositories to install more applications that are not available in the official repository.
Cask
One of the most used repositories is Cask because it provides applications like Google Chrome, Spotify, 1Password, etc.
You don't need to add the repository because already comes with Homebrew.
Homebrew Fonts
This repository has a lot of fonts for your system, to add the repository to you Homebrew you use the command below:
brew tap caskroom/fonts
Now you can install a font for example inconsolata
:
brew cask install font-inconsolata
Search fonts are disabled for this repository because there are bug, so if you want to search fonts you must use this command:
brew cask search /[my-font-name-here]/
Homebrew Science
There are a good number of science packages in this repository, to install packages you can add the repository to your homebrew, this way:
brew tap homebrew/science
Or install a package in particular without adding the repository with this syntax:
brew install homebrew/science/[the-pacakge-name-here]
Graphic interface
Homebrew is a console application as you already noted, but if you want to install a graphic tool, Cakebrew is a graphic tool to manage the homebrew packages.
Cakebrew is on the Cask repository to install this application you can use the command below:
brew cask install --appdir="/Applications" cakebrew
Keep applications updated
These are the commands to update Homebrew packages, the first update the homebrew database and the second one is to upgrade all the outdated packages:
brew update
brew upgrade
The previous command only works for the official repository, if you want to upgrade the packages other repositories you can reinstall the package or use brew-cask-upgrade for Cask repository.
Now you can upgrade the packages installed with Cask using these commands:
brew update
brew cu
Or upgrade a specific package:
brew cu [my-package-name-here]
These are all the options that you can use:
OPTIONS:
If --all or -a is passed, include apps that auto-update in the
upgrade.
If --cleanup is passed, clean up cached downloads and tracker symlinks
after updating.
If --force or -f is passed, include apps that are marked as latest
(i.e. force-reinstall them).
If --yes or -y is passed, update all outdated apps; answer yes to
updating packages.
Useful options
I recommend to clean up the cache and tracker symlinks after upgrading your packages with this command:
brew cleanup
If you have Cask packages installed:
brew cask cleanup
If you want to search a package that is available in your repositories is possible using the search option, for example:
brew search youtube-dl
You also can get extra information about the package with this command:
brew info youtube-dl