Skip to content

tarikkavaz/Clean-Install-macOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Clean Install macOS

Important If you like to follow these instructions keep in mind that you need to use your own information like username and folder locations. I use Dropbox for backup/restore and also my symlinked files (like gitconfig and some dotiles) are located on Dropbox.


Create Bootable USB Disk

  • Download prefered macOS
  • Format USB (min 8GB):
    • Open Disk Utility
    • Click Erase
    • Select OS X Extended (Journaled)
    • Rename USB to Untitled
  • To Create a OS X bootable USB disk enter this command to your terminal:
# Big Sur:
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled

# Catalina:
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled

# Mojave:
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled

# Ventura:
sudo /Applications/Install\ macOS\ Ventura.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled

Backup

Backup Your files to Dropbox.

don't forget your important files like ssh keys:

cp -R ~/.ssh ~/Dropbox/

Start Clean Install

YOU ARE GOING TO DELETE EVERYTHING ON YOUR MAC IN THE NEXT STEP !!!

Write down the next 4 steps. You won't be able to to open your Mac until OS is installed.

  1. Restart & hold down the Option ⌥ alt key.
  2. Choose Install OS X Mojave.
  3. Select Disk Utility from the menu and erase you main HDD.
  4. Go back to the main menu; select Install OS X and choose your HDD when prompted.

Continue installation with your credentials.

Restore your files from Dropbox

  • Download Dropbox and install it.

  • Login to your Acoount.

  • The application will create a Dropbox folder and begin downloading files from your account. Stop the download immediately by clicking the Dropbox icon in your menu bar, clicking the gear icon, and selecting Pause Syncing from the menu.

  • Copy the files from your portable drive into the Dropbox folder. The default location of the folder on your Mac is /Users/yourUserName/Dropbox (such as /Users/Robert/Dropbox).

  • Resume syncing by clicking the Dropbox icon in your menu bar, clicking the gear icon, and selecting Resume Syncing from the menu.

    Source

Install Xcode From Appstore

Install Command Line Tools

xcode-select --install

Install Brew

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

Install Brew Packages

brew install bash bash-completion gettext libffi openssl@1.1 xz cask coreutils curl fabric icu4c jpeg ffmpeg gdrive git git-extras grep guetzli highlight hr imagemagick libyaml mas mono mysql nvm pkg-config postgresql rsync ssh-copy-id stormssh stormssh-completion tree unar wget youtube-dl
# Restart Terminal

Restore .ssh files

cd
mkdir ~/.ssh
cd Dropbox/.ssh 
cp id_rsa* ~/.ssh/
ln -s ~/Dropbox/Dotfiles/configs/ssh_config ~/.ssh/config

Set Permissions

chmod 400 ~/.ssh/id_rsa

Install Dotfiles

git clone https://github.com/tarikkavaz/dotfiles-light.git $HOME/Dotfiles
bash $HOME/Dotfiles/scripts/install.bash
# Restart Terminal

Fork the repo to your account. use your github username as USER_NAME

cd ~/Dotfiles/
git remote rename origin upstream 
git remote add origin git@github.com:tarikkavaz/dotfiles-light.git
git push -u origin master

Dotfiles Private files

cd ~/Dotfiles/
mkdir private

Symlink private Dotfiles. I have added sample env and my-ps1 files to the repo. You can create your own alias and function files if needed.

ln -s ~/Dropbox/Dotfiles/private/alias ~/Dotfiles/private/alias
ln -s ~/Dropbox/Dotfiles/private/env ~/Dotfiles/private/env
ln -s ~/Dropbox/Dotfiles/private/functions ~/Dotfiles/private/functions
ln -s ~/Dropbox/Dotfiles/private/my-colors ~/Dotfiles/private/my-colors
ln -s ~/Dropbox/Dotfiles/private/my-ps1 ~/Dotfiles/private/my-ps1

Symlink git aliases, settings

ln -s ~/Dropbox/Dotfiles/configs/gitconfig ~/.gitconfig
ln -s ~/Dropbox/Dotfiles/configs/gitignore_global ~/.gitignore_global

Install Ruby

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
# Restart Terminal

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/rbenv/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars
git clone https://github.com/rbenv/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems

Create default-gems file

nano $(rbenv root)/default-gems
echo "bundler" >> $(rbenv root)/default-gems
echo "pry" >> $(rbenv root)/default-gems

Install Ruby 2.6.2

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)" rbenv install 2.6.2
rbenv global 2.6.2 
# Restart Terminal

Install Python

git clone https://github.com/pyenv/pyenv.git ~/.pyenv 
# Restart Terminal

If you need a different Python version; do this on that project folder:

CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2 pyenv install 3.7.1
pyenv global 3.7.1
# Restart Terminal

Install Plug-in's

git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
git clone https://github.com/yyuu/pyenv-pip-rehash.git ~/.pyenv/plugins/pyenv-pip-rehash

Install nvm

Install script

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Install required version

nvm install 6.3
nvm alias default 6.3

Install your npm modules

npm install -g bower
npm install -g gulp-cli
npm install -g electron
npm install -g @vue/cli

curl -s -L https://raw.github.com/guedes/pgvm/master/bin/pgvm-self-install | bash

Install Apps

Change the default Gatekeeper behavior to run apps downloaded from anywhere.

sudo spctl --master-disable

From Brew Cask

Install Homebrew Cask

The code below Should be in your .bash_profile or Private Dotfile. Check if you have it already in your symlinked files like env

export HOMEBREW_CASK_OPTS="--appdir=/Applications --fontdir=/Library/Fonts"

Install Cask Updater

brew tap buo/cask-upgrade

Install Cask Apps

Search available Cask Apps

brew cask install alfred appcleaner bartender betterzip brooklyn clipy codekit copyclip db-browser-for-sqlite docker figma fliqlo flotato google-chrome iterm2 liya moom notion padbury-clock qlcolorcode qlimagesize qlmarkdown qlprettypatch qlstephen quicklook-csv quicklook-json screens-connect sequel-pro skype slack spotify sublime-text suspicious-package teamviewer telegram-desktop the-unarchiver tripmode typora visual-studio-code vlc webpquicklook whatsapp xquartz

From App Store

  • AdBlock
  • Airmail
  • Keynote
  • Microsoft Excel
  • Microsoft PowerPoint
  • Microsoft Word
  • Numbers
  • Pages
  • Pixelmator Pro
  • Surfshark
  • TweetDeck

Or use mas

mas install 1402042596 918858936 409183694 462058435 462062816 462054704 409203825 409201541 1289583905 1437809329 485812721

Homebrew Bundle

Create your own Homebrew Bundle for installing all your apps and dependencies with one single file

From Web

Themes

* = Paid App

About

Clean Install macOS Mojave

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published