When I first attempted to learn how to program I was very lucky to have an extremely smart and experienced developer set up my machine to get me started. Our first step was installing Homebrew.
No, not that kind of homebrew 😅(Photo by Lance Anderson on Unsplash)
Homebrew is a package manager for OSX designed to make life easier. Package managers handle all the installation and dependency stuff for you. As a beginner, this was a vital lesson to be learned. Learning to program can sometimes look more like 70% configuration and about 30% coding. Especially in the beginning. So when I found out that there are tools out there to make the configuration easier I held on and praised the smarter people who came before me.
So before we dive into our little tutorial for Homebrew, let's talk about packages.
Not those kind of packages.. (Photo by chuttersnap on Unsplash)
A package is a bundle of installable source code. If you wanted to download a package manually it can get a little tricky because sometimes there are dependencies (software that relies on other software to operate) that are needed for a successful installation. After the package has been successfully installed keeping it up to date manually can be difficult as well.
There are many different package managers some handle packages in binary form and some are source code based. There are system and language package managers as well.
Homebrew is "the missing package manager for macOS" since there is no built-in package manager for macOS. It's a free and open-source software package management system and was created by Max Howell. Homebrew makes it easy to install command line software and tools on a Mac.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
For more information visit https://docs.brew.sh/ or use
Homebrew relies on a git repository that stores the formulaes to install various packages. In our examples Replace
brew search <name>
brew install <name>
brew remove <name>
brew cask search <name>
brew cask install <name>
brew cask uninstall <name>
brew upgrade <name>
brew pin <name>
brew unpin <name>
brew cleanup <name>
brew cleanup -n
brew uninstall --force <name>
Which is usually: ~/Library/Caches/Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
An illustrated guide on that other kind of homebrew 🍻
This tutorial leaves out how to make your own formulas but it should be enough to get a basic understanding of why Homebrew is useful and how to get started. Cheers!