Automate Mac OS X Configuration by using Brewfile

Satoru Sasozaki
2 min readSep 24, 2016

This is a post written on 2016–1–14 and transferred from satorusasozaki.com.

Why I came to do this

You have been using for a while and you might realize you have got a lot of unknown stuff which are most likely trash. When I realize that, all I do is to erase all of my data and reinstall OS. Since my data is all on Dropbox and Google Drive, I don’t really need to backup my mac. But I have to install applications or programs that I need manually which is very tiring and time-consuming. I have decided to automate this process by using Brewfile. I have been using Homebrew as a package manager for a year. Here is the further information about Homebrew.

Things you need to know

Homebrew : A package manager which helps you to install softwares. e.g.

$ brew install git

Homebrew-cask : A tool which helps you to install Mac applications by using Homebrew. e.g.

$ brew cask install google-chrome

Brewfile : A file where you define softwares and applications you want to install. e.g.

Brew Bundle : A Homebrew subcommand to run your Brewfile. e.g.

$ brew bundle

Brew tap : A Homebrew subcommand to add additional repositories which are not in the official formulae. e.g.

$ brew tap neovim/neovim

Steps

1) Install Homebrew

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2) Install brew bundle command

$ brew tap Homebrew/bundle

3) Prepare your Brewfile. For example, here is mine. It’s also on my Github.

# specify a directory to install
cask_args appdir: '/Applications'
# install packages
tap 'caskroom/homebrew-cask' || true
brew 'git'
brew 'bash-completion'
brew 'tree'
brew 'node'
tap 'neovim/neovim' || true
brew 'neovim'
# need to install java before jenkins
cask 'java'
brew 'jenkins'
brew 'wget'
# Casks
cask 'google-chrome'
cask 'dropbox'
cask 'alfred'
cask 'evernote'
cask 'flux'
cask 'skype'
cask 'virtualbox'
cask 'slack'
cask 'spotify'
cask 'kindle'
cask '1password'
cask 'iterm2'
cask 'calibre'
cask 'dash'

Try brew bundle to run the Brewfile. If it worked without any errors, then you are ready to use it after erase and reinstall OS.

--

--

Responses (1)