Skip to content

Instantly share code, notes, and snippets.

@tfeldmann
Last active November 27, 2019 11:22
Show Gist options
  • Save tfeldmann/ee7e81708d7926454867bd0a7e7b916d to your computer and use it in GitHub Desktop.
Save tfeldmann/ee7e81708d7926454867bd0a7e7b916d to your computer and use it in GitHub Desktop.
Update all pip packages, brew and brew casks (macOS) and backup a list of the installed software
#!/bin/sh
set -e
PIP=pip3
scriptdir=$(dirname "$0")
listsdir="$scriptdir/lists"
mkdir -p "$listsdir"
echo "Update all python packages..."
$PIP list --local -o --format=freeze | cut -d = -f 1 | xargs $PIP install -U
$PIP list --local --format=freeze > "$listsdir/pip_list.txt"
echo "Update pipx apps..."
pipx upgrade-all
pipx list > "$listsdir/pipx_list.txt"
echo "Update homebrew..."
brew update
brew upgrade
brew list > "$listsdir/brew_list.txt"
echo "Update all brew casks..."
brew cask outdated | cut -d " " -f 1 | xargs -n 1 brew cask reinstall
brew cask list > "$listsdir/brew_cask_list.txt"
echo "Cleanup..."
brew cleanup --prune=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment