Refresh awareness

Snaps update automatically, and by default, the snapd daemon checks for updates 4 times a day. Each update check is called a refresh and is described in more detail in Managing updates.

If a refresh occurs while an affected desktop application is running, refresh app awareness helps to mitigate any potential issues, using a combination of in-place updates, differed updates, and desktop notifications.

  1. In-place updates
  2. Deferred updates
  3. Desktop notifications

Refresh awareness requires snapd 2.57+

Service management is not affected, as services are started and stopped manually as part of the refresh process, unless a specific endure value has been embedded into the snap by the snap developer. See Services and daemons for further details.

In-place updates

If an application is running when an automatic refresh detects an update, the new snap revision is downloaded in the background to minimise the refresh time.

When the download is complete, the user is notified of the pending update and a snap refresh is triggered when the application stops.

Snap pending update notification

Once the snap has been refreshed, an additional notification informs the user that the new snap revision is ready to be used (requires snapd 2.59.2+)

In-place updates only work with automatic refreshes, and not when a refresh is triggered manually.

Deferred updates

An update can be postponed for up to 14 days for a running application. The update will be either applied when the application closes, during next automatic refresh occurs without the application running, or after 14 days even if the application remains active.

After closing the affected application, the refresh can be triggered manually with the snap refresh command, either globally for all snaps, or with the specific snap name:

snap refresh <snap-name>

If a manual refresh detects the application is still running, the error output will include the detected process ids of the running applications:

error: cannot refresh "firefox": snap "firefox" has running apps (firefox), pids:
       1639,1854,1912,1932,3514,3632,5814,5870

See Managing updates for more details controlling update frequencies, and holding updates for any period of time.

Desktop notifications

While an affected application is running, each refresh attempt will trigger a desktop notification to inform the user that the app should be closed to avoid disruption.

On the default Ubuntu GNOME desktop, notifications can be modified and disabled by selecting Notifications from the Settings application and selecting the Snapd User Session Agent application:

Other desktop environments have equivalent functionality.

See Refresh awareness security policy for details on how refresh updates accommodate confinement and security policy requirements.

2 Likes

This page mentions the postponement of installations for “up to 14 days”. This implies that the interval is not fixed. So it would be helpful if information on how to change / configure the interval could be added.

Is there a way to force refresh even when a running process is detected ? I have a snap which uses snapd REST api’s to perform installs of snaps, the problem is it can not update itself . Is there a work around for this?

Is it enabled by default in snapd 2.57+ on any distro, or only when running on Ubuntu 22.04 LTS and higher?

This is a really good question - thanks for bringing it up. It’s a snapd feature, so should be distro-agnostic. I’ve just tried on Mint (where the update was halted and a notification appeared) and CentOS Stream (where the update was halted). I’ll update the doc to make this clearer.

The final link on this page, “Refresh awareness security policy”, seems broken.

Fixed, thank you (and for all your other comments).