Update ''ALL'' command



  • Hi there

    I remembered there was a post about a command that updated everything at once… rather than doiing one by one, but I’ve trawled through the posts yet again and cannot see it, or even remember what the topic title was - I’m sure it had nothing to do with updating and it was just some poster offering advice to the op, so that great tip was lost.

    Can anyone tell me what that command is? I want to update everything, including the Node, as I’ve never done that at all.
    I’ve already done the firmware

    sudo rpi-update

    and wasn’t sure if that took care of the node too?

    Thanks very much in advance


  • Moderator

    If you run

    sudo apt-get update
    sudo apt-get dist-upgrade
    

    the raspian system will update its lists and upgrade all applications found



  • @yawns

    Thanks… I had mines wrote down wrong as I have that in my Hints and Tips folder, so thanks for the correction…
    I am still looking for the post that someone else posted and will paste back here so someone can point out if his (longer) version does the same or not?

    Found it, but it wasn’t a terminal command as I thought… it was a script :-(

    Binog 2 months ago
    But is there a way (a sh-script) to update MM and all (!) of the installed (different) modules in a batch. I now do have to go through all the directories recursively. That takes lots of time and is quite annoying. Any idea?
    Thx Jimmy

    https://forum.magicmirror.builders/topic/361/how-to-update/12

    izanbard 2 months ago
    I use this script, which comes with no guarantee:

     #!/usr/bin/env bash
    
    cd /home/pi/MagicMirror
    echo "######### CHECKING MAGIC MIRROR ##########"
    git fetch
    if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]
    then
        echo "######### UPGRADING MAGIC MIRROR #########"
        git pull
        npm install
    else
        echo "######## NO UPGRADE REQUIRED #########"
    fi
    echo ""
    
    cd modules
    
    for directory in *; do
        if [[ -d ${directory} && ${directory} != "node_modules" && ${directory} != "default" ]]; then
            echo "######### CHECKING ${directory} ##########"
            cd ${directory}
            git fetch
            if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
                echo "######### UPGRADING ${directory} #########"
                git pull
                if [[ -e "package.json" && -f "package.json" ]]; then
                    npm install
                fi
            else
                echo "######## NO UPGRADE REQUIRED #########"
            fi
            echo ""
            cd ..
        fi
    done
    
    4
    

Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.