103

I know that I can update a snap package using

sudo snap refresh <package>

But is there a way to update all snaps, like

sudo apt dist-upgrade
161
snap refresh 

will do this. It is part of snapd 2.0.8, which landed 2016-06-13 in xenial-updates.

  • 12
    snap refresh --list only lists the updates without refreshes the packages – gwarah Jan 4 '18 at 14:15
  • You need to do sudo snap refresh – Boris Apr 25 at 4:03
20

According to Snap tutorial Snaps are automatically updated in the background once per day.

4

Try this in /usr/bin/update-snaps:

#!/bin/bash
ROOT_UID="0"

#Check if run as root
if [ "$UID" -ne "$ROOT_UID" ] ; then
        echo "You must be root to do that!"
        exit 1
fi

snap list | awk -F" " '{if ($1 && NR>1) { system("snap refresh " $1 " 2>/dev/null") }}'
  • 3
    This is not necessary any more. – dholbach Jun 14 '16 at 7:11
  • Why not? auto-updates, right? – Ambigus9 Jun 26 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.