Skip to content

Instantly share code, notes, and snippets.

@Daniel-M
Last active August 22, 2016 20:30
Show Gist options
  • Save Daniel-M/006c76761735ae114d79d704c7a80e59 to your computer and use it in GitHub Desktop.
Save Daniel-M/006c76761735ae114d79d704c7a80e59 to your computer and use it in GitHub Desktop.
Update all installed packages installed via pip and pip3 in Debian
#!/bin/bash
# Simplified forms using awk
pip install --upgrade $(pip list | awk '{printf(" %s ",$1)}')
pip3 install --upgrade $(pip3 list | awk '{printf(" %s ",$1)}')
# Alternative forms using sed
#pip install --upgrade $(pip list | awk -F" " '{print $1}' | sed ':a;N;s/\n/ /g;ba') # Alternative form
#pip3 install --upgrade $(pip3 list | awk -F" " '{print $1}' | sed ':a;N;s/\n/ /g;ba') # Alternative form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment