Configure A macOS with Intel chip From Scratch

The new macOS Big Sur has an impressively pretty UI, so today I tried to install it on my old 2015 macbook pro. This is not my primary working computer, as I am not sure if the Big Sur is stable enough and compatible with all my software. As I mostly work with the command line and text editors, after the system installation, I reconfigured my favorite working environment from scratch. This is note could serve as a complete recipe when I (have enough money to) buy a new computer.

Update on Jul 12, 2022:
Yeah I bought the new M1 chip macbook, and here is the new cookbook to set up.

My system version is macOS 11.1, with Intel chip.

1. Command Line Tools and Homebrew

On a brand new system, first install the basic command line tool and Homebrew package manager.

Run following codes in the Terminal, it should prompt an installation GUI to get you through, just follow their instructions.

xcode-select --install

It is possible that you have installed command line tools before. If that is the case, you will see some words like “xcode-select: error: command line tools are already installed”. It is totally Ok, just move to the Homebrew installation.

Then install Homebrew with:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After the installation, run brew in the Terminal, if you see some brew tutorial words as “Example usage…”, you are ok with the step.

2. Set up Git config and Github HTTP/SSH token

Then set up Git config and Github token on the computer, you can interact (push and pull) with Github repos in a password-free manner. You should have a github account before this step, you can register for free if you haven’t.

First Config your github username and email in global parameters, s.t. Github serve will know who you are:

# Remove the quotation marks and replace the words inside with your account info
git config --global user.name "user-name"
git config --global user.email "user-email"

Check all configs:

git config --list

For a convenient password-free manner, you can use HTTP token (preferred) or SSH token:

Update on Jan 18, 2021:
Github makes a safety update that requires all personal user to use a personal access token for command line git access. See ref. Previous password access will be no longer supported after August 13, 2021. How to update can be found here and here

With either one of the above 2 methods, you can interact with Github in a password-free manner.

3. Install Miniconda

As I am mostly working with python, I use miniconda to manage python packages and virtual envs. Check here to see why I choose Miniconda over standard Anaconda.

To install miniconda, you have to download the installer according to your system here

Then, change to the directory with the installer in Command line, run:

bash Miniconda3-latest-MacOSX-x86_64.sh

4. Install Oh-my-zsh, theme and useful plugins

This is my favorite part. I use zsh instead of bash as my local shell because zsh has pretty themes as well as powerful plugins, and Oh-my-zsh provides an elegant way to manager them. Here is how to install them.

I am looking for a way to make this oh-my-zsh work on Harvard’s Odyssey cluster

First, change your shell to zsh. macOS has zsh as its default shell, but you can check and change shell with the following codes:

Then, according to their documentation, install oh-my-zsh with:

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

There will be a .zshrc text file in your home directory. You can easily change words inside and source ~/.zshrc to make a new configuration happen. I have uploaded my configuration files, theme (I modify the af-magic theme) and Terminal color scheme in this repo. Here is how my prompt looks like:

prompt look like

You can explore your favorite themes here. Another (or main) highlight of oh-my-zsh is its convenient management of abundant powerful plugins, which will make the working process much more productive and enjoyable. I list my favourite plugins here, there are more than 200 plugins you can explore here

4.1 Easy-set plugins: git, sublime, web-search, osx, vi-mode

Easy-set plugins are really “easy to set”, you simply add the plugin name in to the plugins line in ~/.zshrc and source the file, like:

plugins=(git sublime web-search macos vi-mode)

4.2 Have-to-install plugins: zsh-autosuggestions, zsh-syntax-highlighting, autojump

These plugins are not included in a standard oh-my-zsh distribution, but you can still easily install them by one more line

References


Comments