Update #1: Post updated to reflect macOS’ move to zsh and the move to Python3 (09/06/2020).

Every year I do a clean install of the latest macOS, to mostly get rid of the things I accumulated throughout the year that I no longer use and force myself to do some housekeeping. Whether after a clean install or just getting my hands on a new Mac, I find myself going through the same process every time. In this post, I document this workflow for my future self and hopefully for the benefit of others.

# Before

Back in the day, backing up all of my data just before a clean install was a painful process but thanks to iCloud, which now takes care of backing up my bookmarks, passwords, etc., it is now a straightforward process. All I have to do is copy my files in ~/\$USER to an external hard drive. P.S. I do this in addition to the Time Machine backup just in case!

# Format

Prepare a bootable macOS installer, erase the main drive, and install the OS. A nice guide for this can be found here.

# Settings & Software

First, copy your files back and change the trackpad, keyboard, user, etc. settings back to your liking. Don’t forget to turn off font smoothing. I also have a bunch of dot files that contain paths, aliases, etc. to make things easier. I keep these files in this Github repository, some of these files might be useful.

Also, install your favorite editor, TeX/iWork/Office, and other software you regularly rely on, as well as, themes and colors.

The remainder of the workflow will be run from the terminal.

# Command Line Tools

Second, we’ll install the command line tools:

Don’t forget to accept the license agreement after installation before moving on if you’re installing Xcode.

# Package Manager

Install a package manager, Homebrew (or Macports):

# Some Standard Packages

A version control system - Git (or preferred alternative):

A minimal .gitconfig for Git settings.

A C compiler - GCC; this is also a dependency for later packages:

Python3:

The world’s best text editor :) - Vim:

A minimal .vimrc for some sensible vim settings.

It’s useful to have Ruby and Gem installed:

This website is built with jekyll:

# Scientific Stack

I used to follow a somewhat involved process. Now, installing the usual suspects NumPy, SciPy, MatPlotLib, Jupyter, and Virtualenv is as simple as:

Other packages should probably be installed within a virtual environment.

(While you’re at it, do consider donating :) to the open-source community.)

Finally, the machine learning toys - scikit-learn and PyTorch:

# End

That’s all folks! I find this to be a minimal setup to get up and running. Other tools can be installed later when needed and probably within the project scope.

Citation: