Pip, update all packages with one command

Pip is a package manager for Python. It’s a great tool to install and update packages. This post show how to update all packages with a one liner because the options os not offered by pip.

List all outdated packages

To list all outdated packages, you can use the following command:

pip list --outdated

Update all packages

To update all packages, you can use the following command:

pip list --outdated | awk -F ' ' 'NR>2{print$1}' | xargs pip install --upgrade

Bash aliases

You can create a bash alias to update all packages with one liner:

alias pip-list-outdated="pip list --outdated"
alias pip-update-all="pip list --outdated | awk -F ' ' 'NR>2{print$1}' | xargs pip install --upgrade"