Score:0

How to verbose steps while refreshing Ubuntu Snap packages?

lk flag

I want to see all logs and changes while updating my snap packages, just like sudo apt update && sudo apt upgrade. I use sudo snap refresh to upgrade them manually but there is no switch to see more logs and applying changes.

Download snap "snapd" (19993) from channel "latest/stable" 17% 1.74MB/s 17.0s
Download snap "snapd" (19993) from channel "latest/stable" 22% 1.48MB/s 18.7s
Download snap "snapd" (19993) from channel "latest/stable" 22% 1.33MB/s 20.8s
Download snap "snapd" (19993) from channel "latest/stable" 22% 1.03MB/s 26.8s
Download snap "snapd" (19993) from channel "latest/stable" 48%  656kB/s 28.2s
Download snap "snapd" (19993) from channel "latest/stable" 53%  689kB/s 24.6s
Download snap "snapd" (19993) from channel "latest/stable" 59%  748kB/s 19.5s
Download snap "snapd" (19993) from channel "latest/stable" 84%  948kB/s 5.90s
Download snap "snapd" (19993) from channel "latest/stable" 92%  984kB/s 3.03s
2023-08-22T22:09:50+03:30 INFO Waiting for automatic snapd restart...
snapd 2.60.2 from Canonical✓ refreshed

The output of sudo snap refresh --help command.

[refresh command options]
      --color=[auto|never|always]          Use a little bit of color to highlight some things. (default: auto)
      --unicode=[auto|never|always]        Use a little bit of Unicode to improve legibility. (default: auto)
      --abs-time                           Display absolute times (in RFC 3339 format). Otherwise, display relative
                                           times up to 60 days, then YYYY-MM-DD.
      --no-wait                            Do not wait for the operation to finish but just print the change id.
      --channel=                           Use this channel instead of stable
      --edge                               Install from the edge channel
      --beta                               Install from the beta channel
      --candidate                          Install from the candidate channel
      --stable                             Install from the stable channel
      --devmode                            Put snap in development mode and disable security confinement
      --jailmode                           Put snap in enforced confinement mode
      --classic                            Put snap in classic mode and disable security confinement
      --amend                              Allow refresh attempt on snap unknown to the store
      --revision=                          Refresh to the given revision
      --cohort=                            Refresh the snap into the given cohort
      --leave-cohort                       Refresh the snap out of its cohort
      --list                               Show the new versions of snaps that would be updated with the next refresh
      --time                               Show auto refresh information but do not perform a refresh
      --ignore-validation                  Ignore validation by other snaps blocking the refresh
      --transaction=[all-snaps|per-snap]   Have one transaction per-snap or one for all the specified snaps (default:
                                           per-snap)
      --hold=                              Hold refreshes for a specified duration (or forever, if no value is
                                           specified)
      --unhold                             Remove refresh hold

What should I do?

Score:0
cn flag

snap changes (not 'snap refresh changes') will list the recent installs, refreshes, and removals. "Recent" means same session of snapd.

Here's an example showing a removal, refresh, and install actions today:

                                 # snapd refreshed and restarted earlier
$ snap changes                   # today so older data is lost
ID   Status  Spawn               Ready               Summary
272  Done    today at 10:05 CDT  today at 10:05 CDT  Auto-refresh snap "rpi-imager"
273  Done    today at 14:13 CDT  today at 14:13 CDT  Remove "rpi-imager" snap
274  Done    today at 14:16 CDT  today at 14:17 CDT  Refresh snap "snapd"
275  Done    today at 14:23 CDT  today at 14:23 CDT  Install "rpi-imager" snap

Note the ID number. If we want additional verbosity, we can use that number:

$ sudo snap change 271             # You cannot use the ID Number to see older changes
error: cannot find change with id "271"


$ sudo snap change 275
Status  Spawn               Ready               Summary
Done    today at 14:23 CDT  today at 14:23 CDT  Ensure prerequisites for "rpi-imager" are available
Done    today at 14:23 CDT  today at 14:23 CDT  Download snap "rpi-imager" (465) from channel "stable"
Done    today at 14:23 CDT  today at 14:23 CDT  Fetch and check assertions for snap "rpi-imager" (465)
Done    today at 14:23 CDT  today at 14:23 CDT  Mount snap "rpi-imager" (465)
Done    today at 14:23 CDT  today at 14:23 CDT  Copy snap "rpi-imager" data
Done    today at 14:23 CDT  today at 14:23 CDT  Setup snap "rpi-imager" (465) security profiles
Done    today at 14:23 CDT  today at 14:23 CDT  Make snap "rpi-imager" (465) available to the system
Done    today at 14:23 CDT  today at 14:23 CDT  Automatically connect eligible plugs and slots of snap "rpi-imager"
Done    today at 14:23 CDT  today at 14:23 CDT  Set automatic aliases for snap "rpi-imager"
Done    today at 14:23 CDT  today at 14:23 CDT  Setup snap "rpi-imager" aliases
Done    today at 14:23 CDT  today at 14:23 CDT  Run install hook of "rpi-imager" snap if present
Done    today at 14:23 CDT  today at 14:23 CDT  Run default-configure hook of "rpi-imager" snap if present
Done    today at 14:23 CDT  today at 14:23 CDT  Start snap "rpi-imager" (465) services
Done    today at 14:23 CDT  today at 14:23 CDT  Run configure hook of "rpi-imager" snap if present
Done    today at 14:23 CDT  today at 14:23 CDT  Run health check of "rpi-imager" snap
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:udisks2 to snapd:udisks2
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:gsettings to snapd:gsettings
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:gtk-3-themes to gtk-common-themes:gtk-3-themes
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:hardware-observe to snapd:hardware-observe
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:home to snapd:home
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:icon-themes to gtk-common-themes:icon-themes
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:sound-themes to gtk-common-themes:sound-themes
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:wayland to snapd:wayland
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:x11 to snapd:x11
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:desktop to snapd:desktop
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:desktop-legacy to snapd:desktop-legacy
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:opengl to snapd:opengl
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:mount-observe to snapd:mount-observe
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:network to snapd:network
Done    today at 14:23 CDT  today at 14:23 CDT  Connect rpi-imager:removable-media to snapd:removable-media
Done    today at 14:23 CDT  today at 14:23 CDT  Setup snap "rpi-imager" (465) security profiles for auto-connections

Install, refresh, and removal information is currently available only from snapd. It's not logged in either journal or syslog. However, the inverse is true when refreshes AREN'T available: snap changes is silent, but the check is logged.

$ journalctl --unit=snapd --lines=1
Aug 22 14:24:25 my-system snapd[338944]: storehelpers.go:773: cannot refresh: snap has no updates available: "bare", "core", "core20", "core22", "cups", "discord", "firefox", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "gtk2-common-themes", "hunspell-dictionaries-1-7-2004", "inkscape", "lxd", "rpi-imager", "snapd", "snapd-desktop-integration", "thunderbird"

$ grep snapd /var/log/syslog | tail -n1
2023-08-22T14:24:25.365238-05:00 my-system snapd[338944]: storehelpers.go:773: cannot refresh: snap has no updates available: "bare", "core", "core20", "core22", "cups", "discord", "firefox", "gnome-3-38-2004", "gnome-42-2204", "gtk-common-themes", "gtk2-common-themes", "hunspell-dictionaries-1-7-2004", "inkscape", "lxd", "rpi-imager", "snapd", "snapd-desktop-integration", "thunderbird"
lk flag
Thank you very much for your complete answer + example.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.