How to Install Particular Versions of Packages with Snap

Snap is a software package management platform created by Canonical for installing and managing package applications on Linux.

Unlike traditional package managers, Snap packages (or “snaps“) are self-contained applications that come with all the needed dependencies to reduce package conflicts across all Linux distributions.

This article will go through the steps to install a specific package version using Snap and provide some examples of common Snap commands.

Installing Snapd in Linux

To install the snapd daemon and enable snap package support, use the following appropriate command for your specific Linux distribution.

On Ubuntu and Debian-based distributions.

sudo apt install snapd

On Fedora and Red Hat-based distributions.

sudo dnf install snapd
sudo systemctl enable --now snapd.socket

On openSUSE.

sudo zypper install snapd
sudo systemctl enable --now snapd.socket

On Arch Linux.

sudo yay -S snapd
OR
sudo pacman -S snapd
sudo systemctl enable --now snapd.socket

Once the installation is complete, reboot your machine for the settings to take effect, or log out and log back in.

Installing a Specific Version of a Package

Snap packages often come in different versions, and sometimes you need a specific version for compatibility or testing purposes. Here’s how you can install a specific version.

Find Available Versions of Snap Packages

To see the available versions of a Snap package called ‘vlc‘, you can use the snap info command.

snap info vlc
Find Versions of Snap Packages
Find Versions of Snap Packages

Install a Specific Version of the Package

To install the particular version of the package, use the --channel option, which can be stable, candidate, beta, or edge followed by the version number.

For example, to install VLC version 3.0.20 from the stable channel, use:

sudo snap install vlc --channel=latest/stable

After installation, verify the installed version of ‘vlc‘ using the snap list command.

snap list vlc
Install Specific Version of Snap Package
Install Specific Version of Snap Package

Switch to a Different Package Version

Switching to a different version of a Snap package is a useful feature that allows you to change the installed version without removing and reinstalling the package.

For example, to switch to a different version of ‘vlc’ package, use the --channel option with a desired channel and version of the package as shown.

sudo snap refresh vlc --channel=latest/beta

After switching the version, verify the change using the snap list command.

snap list vlc
Switch to Different Package Version
Switch to a Different Package Version

Downgrade Package to the Specific Version

If you find the updated or installed version of VLC unsatisfactory, you can revert to the previously installed version using the snap revert command.

sudo snap revert vlc

This command will roll back VLC to the version that was installed before the most recent update.

After reverting, you can again verify the installed version of VLC to ensure it has been reverted successfully.

snap list vlc
Downgrade Package to Specific Version
Downgrade Package to Specific Version

Removing a Snap Package

To remove a snap package called ‘vlc’, use the snap remove command, which will uninstall the specified Snap package from your system.

sudo snap remove vlc

After removing the package, you can verify that it has been successfully removed by listing installed Snap packages.

snap list
Remove Snap Packages
Remove Snap Packages
Conclusion

Using Snap to manage packages in Linux is straightforward and powerful, especially when you need to handle specific versions of applications.

By following the steps outlined in this article, you can easily install and manage different versions of Snap packages.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

Ravi Saive
Ravi Saive
Administrator
About the author

I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.