Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

An error occurred while submitting your form. Please try again or file a bug report. Close

  1. Blog
  2. Article

Igor Ljubuncic
on 27 February 2020


We’d like to follow up on last week’s article about parallel installs for classic snaps with another bleeding-edge topic. Today, we will discuss snap refreshes. By design, snaps come with automatic updates, and by default, the update (refresh) frequency check is four times a day. Whenever new application versions are published, they soon become available and propagate to all end-user systems.

Normally, the process is transparent and seamless, but there could be exceptions. For instance, if you have an app open and running, an update could be disruptive in the middle of your work. Some developers have asked for an option to inhibit refreshes of snaps while they are running, and this is now a new, experimental feature that you can enable and test on your system.

Opt-in for refresh app awareness

As with many early access capabilities, you need to toggle an experimental flag on. Your system needs to be running snapd 2.39 or newer (you can run snap version in a terminal window to determine which version of snapd your system is running), and you need to execute this command:

snap set core experimental.refresh-app-awareness=true

For consistency purposes, you should restart all your running snaps, or reboot the machine.

Testing, testing

Once the feature has been enabled, you can try to refresh a running snap. If an application is busy (either running or has hooks), the refresh will be inhibited. For example, you can try this with the Okular PDF viewer. The stable version is currently 19.04.2, whereas the candidate version is 19.12.1.

channels:
  stable:    19.04.2        2019-07-05 (63) 20MB -
  candidate: 19.12.1        2020-01-08 (79) 21MB -
  beta:      ↑                                 
  edge:      master+c1afa35 2020-02-12 (82) 18MB -

If you try to refresh to candidate while you have the application open, you will see the following output on the command line:

snap refresh okular --candidate
error: cannot refresh "okular": snap "okular" has running apps (okular)

On the other hand, once you close the application, the update will be applied:

okular (candidate) 19.12.2 from KDE✓ refreshed

This feature allows you to gracefully time the updates of your applications, and thus ensure the least amount of disruption to your work. The refresh timeout is not indefinite, though. After a certain period (current default is 7 days), the update will be triggered. However, as with any preview technology, things can change. Moreover, at the moment, the refresh inhibition is mostly manual. In the future, snapd will likely include the option to update snaps once the user completes their work and closes the application(s).

Summary

The app refresh capability offers snaps users another level of control in the overall user experience. Automatic updates are geared toward security, but users can defer updates for up to 60 days, and now, they also have the ability to gracefully update applications with minimal disruption to their normal usage patterns and workflows.

We very much welcome your feedback and suggestions, especially with new and upcoming features. The refresh awareness option is a good example of where the developer feedback has been valuable and useful in making the snap ecosystem even friendlier and more robust. If you have any ideas on this topic – or any other, please join our forum for a discussion.

Photo by Mario Caruso on Unsplash.

Related posts


Aaron Prisk
3 April 2024

Creating Snaps on Ubuntu Touch

Community Article

This article was written in collaboration with Alfred E. Neumayer of the UBports Project. Tablets, phones and current technology’s capabilities are phenomenal. Who would have thought a thin, light, barely 10 inch device would provide all the power necessary to run Virtual Machines, wherever one desires while powered on battery? That a sma ...


Holly Hall
15 January 2024

Managing software in complex network environments: the Snap Store Proxy

Internet of Things Article

As enterprises grapple with the evolving landscape of security threats, the need to safeguard internal networks from the broader internet is increasingly important. In environments with restricted internet access, it can be difficult to manage software updates in an easy, reliable way. When managing devices in the field, change management ...


Bill Wear
3 January 2024

MOTL: N33 NUC, Part 2

Cloud and server Article

Accessing the BIOS; making a plan My next step is to confirm whether or not the N33 NUC will PXE boot. A moderate Google search didn’t turn up any active documentation that confirmed this. There were feature listings on Amazon for similar NUCS, but who knows if those are reality or marketing? The obvious thing ...