Skip to content

Install Prep

Todd Thomas edited this page May 20, 2024 · 6 revisions

MANUAL STEPS

  1. Upgrades/Updates are easier manually: (I do this right before bed; or the script can do it for you)
    • Patching the system, or
    • Upgrading macOS
  2. You'll need to git clone this repo. On the first git operation, the Xcode Command Line Tools will be installed.
    • Accept the Agreement (macOS UI)
  3. Grant the Terminal Full Disk Access; I'm not sure what Apple hopes to gain with this annoyance.
  4. When all that is done, reboot and run softwareupdate --all --install --force again.
    • For some reason, step 1 is not completely adequate and the CLI Tools are installed again; I'm confused by this.
  5. If coding/testing/contributing to this:
    • Install VMware Tools (I use VMware Fusion)
    • This is a good spot for a SNAPSHOT of the VM.

NOTE: There doesn't seem to be a reliable method to automate the CLI Tools install. If anyone knows how to do this please let me know.

Install Prep Script

As the name implies, it primarily sets the stage for what comes next. The install-prep.sh does a TON of stuff and executes within (min) 10 minutes, longer depending on how behind you are with patching. These are the highlights:

  1. Updates all system software (will NOT Upgrade to the next macOS)
  2. Within an XDG-style directory structure, run: tree ~/.config/ to see it.
  3. Properly configures sudo
  4. Installs Homebrew (which will snag OSX CLI Tools as a dependency). Then homebrew is used to install:
    • GNU programs (sed, bash, awk, find, etc) - we are a Linux-based society after all.
    • Ansible (and the latest Python as a dependency)
    • Python is configured (although I hate how)
  5. Then we install/configure Oh My ZSH with a basic (but very usable) configuration.
    • If you're using ZSH and NOT using Oh My ZSH then you're simply doing way too much work.
  6. These logs are generated at the end:
% tree ~/.config/admin/logs 
/Users/userName/.config/admin/logs
├── apps-find-all-pre-install.log
├── apps-home-dot-dirs-pre-install.log
├── apps-homebrew-pre-install.log
├── apps-paid-pre-install.log
├── apps-pkgutil-pre-install.log
├── install-prep.log
└── libs-pip-python-pre-install.log

To run this script copy/paste the following line:

tools/install-prep.sh TEST 2>&1 | tee /tmp/install-prep.out

NOTE1: TEST does not imply a dry run - it will configure a system. It's intended to reset some conditions while developing this automation.

NOTE2: you're either TESTing or your LIVE. To run live, just omit the word TEST.

When it's all over, you will see something like:

         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ....is now installed!

To finalize the setup, hit CTRL+d.

That's pretty much it. Rebooting is necessary to finalize.


To test the install of CLI Tools, open a new terminal tab and run:

sudo gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Clone this wiki locally