Alan Pope
on 19 July 2018
Snap packages have a rich set of features beyond getting the latest shiny on your Linux distribution. Tracks enable developers to publish multiple supported releases of their application under the same name. With this enabled, a user can switch tracks at any time to install and use an alternate supported relase of software.
Within each track are four standard channels named edge, beta, candidate and stable. The channels represent the risk-level users should expect from the snaps within. Edge snaps (typically built from the latest code committed) would be riskier to use than beta releases, which are more risky than stable releases.
By default every application has one ‘latest’ track and the four named channels. Developers can optionally choose whether to supplement that with additional tracks. Further the developer can choose which channels to use within those tracks.
This is best illustrated with an example such as Skype. Running ‘snap info skype’ will reveal the ‘channel map’ at the bottom. The Skype developers have chosen to use two tracks, the ‘latest’ (default) and ‘insider’ track. Any user installing Skype without specifying a track or channel should expect to receive whatever is in the latest/stable track/channel.
Skype makes use of the insider track to publish newer builds of their software, intended for use by their QA team who are testing the next stable release. Users can switch to the public insider/stable track to join the testing, or confirm a bug which exists in the latest/stable release is already fixed.
Installing from a track/channel can be done on the command line:-
snap install skype --channel=insider/stable
A user who already has Skype installed can switch channel with the snap refresh
command:-
snap refresh skype --channel=insider/stable
Alternatively if using GNOME Software, select the ‘stable’ channel in the store page for Skype, and select a channel to switch to.
In the example we’ve looked at, the Skype developers have chosen to support two tracks – latest and insider. Other developers are supporting many more. The NodeJS and etcd projects have many tracks covering all the supported releases of their software. This enables users to select a software release series and get updates to that major version without being unexpectedly upgraded to the next software series.
For users who prefer to stay on the the most recent published release of software, the latest/stable track and channel is most appropriate. The software will get upgraded at the point when the developer pushes a new release to the latest track, stable channel. Users can switch between tracks/channels at any time, going both forwards and backwards in releases if necessary.
Tracks increase flexibility for developers, access to latest builds for QA teams, and more choice for users.