Skip to content

Instantly share code, notes, and snippets.

@Jamesits
Last active March 12, 2016 02:40
Show Gist options
  • Select an option

  • Save Jamesits/d59aae12ba58627f6daf to your computer and use it in GitHub Desktop.

Select an option

Save Jamesits/d59aae12ba58627f6daf to your computer and use it in GitHub Desktop.
Functions for updating and upgrading everything.
#!/usr/bin/env bash
update() {
case $1 in
# apt-get
apt)
apt update && apt full-upgrade -y
;;
# brew.sh
brew)
brew update && brew outdated && brew upgrade --all && brew cleanup
# Docker
docker)
docker images | awk '{print $1}' | xargs -L1 docker pull
;;
# node.js
npm)
npm update -g
;;
# Pacman
pacman)
pacman -Syy
pacman -Syu --noconfirm
;;
# Python
pip2)
pip2 install --upgrade pip
pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip2 install -U
;;
pip3)
pip3 install --upgrade pip
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
;;
# Ruby
gem)
gem update `gem outdated | cut -d ' ' -f 1`
;;
# yaourt
yaourt)
yaourt -Syy
yaourt -Syu --noconfirm
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment