Skip to content

Instantly share code, notes, and snippets.

@gwax
Last active February 19, 2016 02:12
Show Gist options
  • Save gwax/bc31dab140f257bbe8a7 to your computer and use it in GitHub Desktop.
Save gwax/bc31dab140f257bbe8a7 to your computer and use it in GitHub Desktop.
Upgrade all the things!
#!/bin/bash
# Upgrade applications on system
brew update
brew upgrade --all
# Install latest python versions
pyenv install 2.7.11
pyenv install 3.5.1
# Make sure pip is up to date in new python versions
PYENV_VERSION=2.7.11 pip2 install -U pip
PYENV_VERSION=3.5.1 pip3 install -U pip
# Copy requirements
pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | PYENV_VERSION=2.7.11 xargs pip2 install -U
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | PYENV_VERSION=3.5.1 xargs pip3 install -U
# Switch global versions to latest
pyenv global 2.7.11 3.5.1
# Update all packages
pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip2 install -U
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip3 install -U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment