Software & AppsOperating SystemLinux

How To Install a Specific or Old Version of a Snap Package

Ubuntu 10

Snap is a software packaging and deployment system developed by Canonical for operating systems that use the Linux kernel. The packages, called ‘snaps’ and the tool for using them ‘snapd’, work across a range of Linux distributions allowing distribution-agnostic upstream software packaging. In this article, we will guide you on how to install a specific or old version of a snap package.

Quick Answer

To install a specific or old version of a snap package, you can use the snap revert command to revert to a previous version if it’s cached on your system. If there are no prior versions available, you can check the available channels and their corresponding versions using the snap info command, and then install a specific version using the snap install command with the --channel parameter. If the snap package does not provide multiple channels, you may need to download and install the specific version manually from the software’s website.

Understanding Snap Packages

Snap packages are containerized software packages that are simple to create and install. They auto-update and are safe to run. If you need a specific version of a software or need to revert to an older version, Snap provides several ways to do this.

Reverting to a Previous Version Using Snap Revert

If you have previously installed a newer version of a snap package and want to revert to the older version, you can use the snap revert command. This command reverts the snap to the previous version if it’s cached on your system.

Here is the syntax:

snap revert [snap_name]

Replace [snap_name] with the name of the snap you want to revert. If successful, the system will revert to the previously installed version.

However, this method only works if there are previous versions of the package cached on your system. If there are no prior versions available, you won’t be able to revert using this method.

Installing a Specific Version Using Snap Channels

If you want to install a specific version of a snap package, you can use the snap info command to check the available channels and their corresponding versions.

Here is the syntax:

snap info [snap_name]

Replace [snap_name] with the name of the snap you want to check. The system will display a list of channels and the corresponding versions available for installation.

To install a specific version, use the snap install command with the --channel parameter.

Here is the syntax:

snap install [snap_name] --channel=[channel_name]

Replace [snap_name] with the name of the snap you want to install and [channel_name] with the name of the channel that has the version you want to install.

Downloading and Installing a Specific Version Manually

If the snap package does not provide multiple channels with different versions, you may need to download the snap package directly from the software’s website.

For example, if you want to install a specific older version of Visual Studio Code, you can download the snap package directly from the VS Code updates page.

After downloading the snap package, you can install it using the snap install command with the --dangerous parameter. The --dangerous parameter is necessary because the snap package is not verified by the snap store.

Here is the syntax:

snap install [file_path] --dangerous

Replace [file_path] with the path of the downloaded snap package.

Please note that manually installed snap packages may not receive automatic updates like the ones installed through the snap store.

Conclusion

Snap provides a flexible way to install software packages on Linux. You can easily revert to a previous version, install a specific version from a channel, or manually install a specific version by downloading it from the software’s website. However, always remember to check the software’s documentation or website for the most accurate and up-to-date information.

Can I install multiple versions of a snap package?

No, you can only have one version of a snap package installed at a time. However, you can revert to a previous version using the snap revert command.

How can I check the currently installed version of a snap package?

You can use the snap list command to display all installed snaps and their corresponding versions.

Can I install a specific version of a snap package without using channels?

Yes, you can manually download the specific version from the software’s website and install it using the snap install command with the --dangerous parameter.

Will manually installed snap packages receive automatic updates?

No, manually installed snap packages may not receive automatic updates like the ones installed through the snap store. You will need to manually update them when new versions are available.

Can I revert to a previous version of a snap package if it’s not cached on my system?

No, if the previous version of a snap package is not cached on your system, you won’t be able to revert to it using the snap revert command.

Leave a Comment

Your email address will not be published. Required fields are marked *