shellconda

How to update all in all conda environments?


Instead of manually typing conda update -n envname --all for every environment, How can I update them all at once?

Is there a better way than what I've come up with?


Solution

  • This is the shell script I came up with.

    for var in $(conda env list --json | jq '.envs[]')
    do
    conda update -n $(echo ${var:1:-1} | rev | cut -d'/' -f1 | rev) --all -y -q
    done