6

I want a single command to update everything on my Mac command line. No more brew update && brew upgrade && brew cleanup && brew doctor and npm update -g and that complicated command to update everything in pip3. Is there an existing tool for this, or should I just use a script? Also, is this even a good idea? Is there any benefit to updating all my software individually?

For reference, this is the current function I have in my .zshrc that is supposed to update everything:

function update () {
  (brew update && brew upgrade && brew cleanup && brew doctor) &
  upgrade_oh_my_zsh &
  npm update -g &
  (pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U) &
  (cd ~/.vim_runtime && git pull --rebase)
}
3

After asking this question many places, I've refined the function to be both more comprehensive and predictable (runs the updates in serial, instead of parallel).

This is the final result in my .zshrc:

function update () {
  softwareupdate --install --all
  (brew update && brew upgrade && brew cleanup && brew doctor)
  mas upgrade
  npm update -g
  (pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip3 install -U)
  (gem update --system && gem update && gem cleanup)
  upgrade_oh_my_zsh
  (cd ~/.vim_runtime && git pull --rebase)
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .