Experimental feature: snap refresh awareness and update inhibition

by 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.

  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).


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.

Newsletter Signup

Related posts


在过去几个月我们发布了一些如何使用Rust,Java,C/C++和其他语言来开发snap桌面应用的文章。在这些从入门到精通的教程中,我们以一个代表性的snapcraft.yaml文件来介绍开发构建snap所需的具体细节。 今天,我们希望脱离这一过程,而将重点放在服务器端。我们将为你提供一个包含两个有趣组件的snapcraft.yaml的概述:a)它将拥有多个应用程序; 通常,snap包含一个应用程序。b)它具有简单的后台服务,其他应用程序可以连接到该服务。 我们一起来看一下。 Snapcraft yaml 以下是snapcraft.yaml文件的内容: apps: borg: command: bin/borg daemon: simple restart-conditi […]

Learn snapcraft by example – multi-app client-server snap

Over the past few months, we published a number of articles showing how to snap desktop applications written in different languages – Rust, Java, C/C++, and others. In each one of these zero-to-hero guides, we went through a representative snapcraft.yaml file and highlighted the specific bits and pieces developers need to successfully bui […]

Snapcraft tricks: Improve release flexibility with pull and build overrides

Sometimes, software projects are simple – one architecture, one version, one release. But often, they can be complex, targeting multiple platforms, and with different versions at that. If you are packaging your apps as snaps, you might wonder about the optimal way to accommodate a multi-dimensional release matrix. One yaml to rule them al […]