I find it useful sometimes to update all my packages sometimes.

Some might say that it's stupid dangerous to do so and that I should be cherry picking with care what I want to update and why. But I've never had any issues with that.

Package managers such as gem and brew have those commands built-in:

# update all your brew packages
$ brew update

# update all your gems
$ gem update

But for some reasons, pip cannot do that...

To do so you might use the following command, that I stole from rbp on Stackoverflow:

$ pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

It's quite long to type and even harder to remember. So let's make some aliases that your can add to your .bashrc or .zshrc.

alias pip-update="pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U"
alias pip3-update="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U"

Note the double quotes " around the command. That's because grep is using single quotes ' that are not escaped (I find it cleaner/easier to read). I was first getting an error message because of this and it took me a few minutes to figure it out. I'll remember that next time!

If you're like me and using preszto, I also added those two aliases to the python module.

Don't forget to activate the module in `.zpreztorc.

Feel free to fork and add you own!