Developers will now find it easier to install multiple versions of the same Snap app on the same system.

Snappy, the cross-distro app packaging and distribution format, has gained a new, albeit experimental “parallel install” feature.

When enabled the feature makes it easy to install multiple instances of the same Snap app on the same system, each with its own config and permissions set.

But it gets even better.

As well as supporting parallel installs of the same Snap, and letting users configure them independently of each other, the feature also lets developers change the release channel of each install separately.

This means, for instance, one could install the latest VLC stable release twice, then switch one of them over to the --edge channel to test something (or play a very nerdy game of spot the difference).

Parallel Installs of Snap Apps

Parallel installs of snap apps
Two versions of the VLC Snap app running side-by-side

I really like the command line approach Snappy takes with installing parallels Snaps. There’s nothing fussy or complex to it.

For example, I’d install the first copy of, say, the VLC Snap app as normal:

snap install vlc

And then install a second copy like so:

sudo snap install vlc_2

Because Snapd understands that the underscore means I want the same snap app, but in its own instance, I don’t need to do anything other than give it a name.

I can then switch the second one over to the development channel:

sudo refresh --edge vlc_2

For even more fun I can install a third version of the same app, this time from the beta channel:

snap install --beta vlc_3

Now, if you felt particularly unhinged you could continue to amend the alphanumeric term after the underscore to install the same snap app 100 times over or more (pro tip: use a useful term to differentiate installs, e.g., vlc_dev or gimp_testing).

Minor Caveats

While experimental parallel install let you have multiple versions of the same Snap app installed you, generally speaking, shouldn’t try to run multiple versions of the same app at the same time.

Why? Well, because most software wasn’t designed that way! This is something that Snappy developers point out in a blog post documenting the experimental new feature:

“Parallel installs do offer a great deal of flexibility, but it is important to remember than (sic) most applications are designed to run individually on a system,”

“If you have a snap that runs a service, only one instance will be able to bind to a predefined port, while others will fail,” they add.

On the bright side developers (as well as random software enthusiasts like me) now have an easy way to run multiple versions of the same Snap apps separately, safely, isolated from each other, on the Linux desktop.

My previous approach was to install a Snap, a repo version, and, if third copy was required, an AppImage (where available).

How to Enable Parallel Install in Snapd

For now, the Snapd parallel install option is an experimental feature intended for development and testing purposes only.

The feature requires the following flag to be set, which is only available in Snapd 2.36 onwards:

snap set system experimental.parallel-instances=true

To disable and turn the feature off run the same command again, this time with false at the end:

snap set system experimental.parallel-instances=false

Dev News
#snapcraft #snapd #snappy