Skip to Content

Do snap packages update automatically?

Do snap packages update automatically?

Snap packages are a popular way to install and manage applications on Linux distributions like Ubuntu. One of the key features of snaps is that they can update automatically in the background without user intervention. In this article, we’ll take a closer look at how snap auto-updates work and how to configure them.

What are snap packages?

Snaps are self-contained software packages that include all the dependencies an app needs to run. They bundle together the app binary, libraries, icons, and configuration files. Snaps are designed to work securely across many Linux distributions with no modifications.

Some key advantages of snaps include:

  • Automatic updates – Snaps can update automatically in the background.
  • Isolation – Each snap runs isolated in its own sandbox.
  • Rollbacks – It’s easy to revert to previous versions of an app if needed.
  • Security – Each snap is cryptographically signed and verified.
  • Ease of use – Snaps are easy to install, manage and remove.

Popular apps published as snaps include Slack, Skype, Spotify, Firefox, and many more. Snaps are available from the Snap Store and can be installed with a single command using the snap tool.

How do snap auto-updates work?

One of the standout features of snaps is the ability to auto-update seamlessly in the background. Snap auto-updates work via the following process:

  1. The snapd daemon checks for updates to installed snaps every 4 hours.
  2. When a new version of a snap is available, it is downloaded in the background.
  3. Once the updated snap is downloaded, snapd verifies the cryptographic signature.
  4. If the signature is valid, the updated snap is installed and the previous version disabled.
  5. The application auto-restarts into the new version with no action required from the user.

This auto-update process allows snaps to stay up-to-date without annoying the user with constant upgrade prompts. The updates also occur in a controlled fashion, with snapd managing the entire process including dependencies.

Auto-update configuration

Snap auto-updates are enabled by default, but the behavior can be configured as needed. Here are some useful snap commands for managing auto-updates:

Command Description
snap refresh –time View current auto-refresh timer for updates
snap set core refresh.timer=12h Set refresh timer to 12 hours
snap refresh –hold Temporarily hold updates for all snaps
snap refresh app –hold Hold updates for a specific snap
snap refresh –enable Re-enable auto-updates

The snap refresh command manages the auto-update behavior globally or on a per-snap basis. The timer can be adjusted to check more or less frequently than the default 4 hours. Updates can also be easily held for troubleshooting or temporarily disabled completely.

Update behavior for different release channels

Snaps support release channels similar to other package managers:

  • Stable – Tested, reliable releases (default channel)
  • Candidate – Release candidate, will become next Stable
  • Beta – Pre-release version for testing
  • Edge – Bleeding edge development version

The auto-update behavior can vary depending on the channel:

Channel Update Behavior
Stable Updates to new Stable releases every 2-3 weeks
Candidate Updates to new Candidate releases more frequently
Beta Updates to new Beta versions up to daily
Edge Updates hourly with latest development code

The Stable channel receives the least frequent auto-updates, while the Edge channel will see new updates almost constantly as developers commit code. Keep this in mind when choosing a channel.

How to manually update snaps

Although snaps update automatically, you can also manually trigger an update using the snap command. This pulls the latest version of the snap immediately instead of waiting for auto-update.

To manually update a specific snap:

snap refresh [snap-name]

To refresh all installed snaps:

snap refresh

You can view available updates before refreshing using:

snap list --upgradable

Downgrading to previous snap revisions

If a snap update causes regressions, you can easily revert back to the previous working revision:

snap revert [snap-name]

This will disable the latest revision and re-enable the previous one. You can repeat the revert command to go back further in revisions if needed.

Conclusion

Automatic updates are a useful feature of snaps that keep apps up-to-date without constant user intervention. Snap auto-updates can be configured via the timer and held if needed. Different release channels also impact how frequently new snap revisions are installed. Although snaps update automatically, users can still manually trigger updates and revert to older revisions if issues crop up.