Portable packaging formats were gained lot of popularity in recent days.
Snappy is one of the portable packaging format, which was created by Ubuntu.
It brings new features called parallel install, which allow us to install multiple version of the same snap app on system.
It could be very helpful for developers to test the difference between multiple version of the packages.
You should enable this feature with snap to use, to enable this option is a fairly simple task.
This option is available from version 2.36 on-wards.
How to enable parallel install features in snap?
To do so, run the following command to enable a special flag called parallel installs that manage, which allow snapd to manager this feature.
$ sudo snap set system experimental.parallel-instances=true
We had already wrote an article in this same topic, it’s called Modularity that is designed specifically for RPM based system. Currently, it’s tested and working fine in Fedora systems. It was implemented since Fedora 28.
Once you enabled this feature then your system would have multiple instances of the same snap package, each isolated from the others, with its own configurations, interfaces, services, etc,.
How to install same version of the Snap App multiple times?
To do so, run the following commands.
To install first copy of the VLC.
$ sudo snap install vlc
To install second copy of the VLC. Make a note, Snap can understand and install the second copy of the same package when you give “underscore” while installing the package.
$ sudo snap install vlc_1
Even, you can install multiple copy in single shot.
$ sudo snap install vlc_2 vlc_3 vlc_4
How to install multiple version of the Same Snap App?
To do so, run the following commands. Most of the software’s released in the following patterns.
- Stable Version
- Edge (Preview version)
- Beta Version
Run the following command to check the available version of the snaps for vlc.
$ snap info vlc name: vlc summary: The ultimate media player … channels: stable: 3.0.7 2019-06-07 (1049) 212MB - candidate: 3.0.7 2019-06-07 (1049) 212MB - beta: 22.214.171.124-1-6-gdedb3bd 2019-06-18 (1071) 212MB - edge: 4.0.0-dev-8388-gb425adb06c 2019-06-18 (1070) 329MB -
If you would like to switch them, yes, we can easily do it using this feature.
Alternatively, you can switch the second one over to the development channel.
$ sudo refresh --edge vlc_1
Also, you can even directly install a different version as a separate instance.
$ sudo snap install --beta vlc_5
You can check your installed instances by running the following command.
$ snap list| grep vlc vlc 3.0.7 1049 stable videolan* - vlc_1 4.0.0-dev-… 1070 edge videolan* - vlc_5 3.0.7 1049 candidate videolan* -
If you have done your testing and you don’t need this feature anymore then simple disable it by running the following command.
$ sudo snap set system experimental.parallel-instances=false
You can install multiple version of the Same Snap App but you can be able to run only one instance at a time, if you have a snap that runs a service because the service needs to bind to a predefined port, while others will fail.