Managing Metanorma versions on Linux using Snap
Easily manage Metanorma versions on Linux using Snap packages.
Introduction
There are occasions where a user may want to switch between multiple Metanorma versions, for example:
- publishing a document of older schema no longer supported by newer Metanorma versions
- verifying older documents using old schema
- (the unfortunate) case that a document fails to compile by newer Metanorma versions
On Linux, users typically use Metanorma through Docker containers or the "metanorma" Snap package.
This article describes how to easily manage Metanorma versions through Snap, just with a few commands.
Snap packages
Snapcraft is a universal Linux packaging system, originally developed by Canonical of Ubuntu Linux fame, that allows developers to package their applications and dependencies, making it easy to distribute and install software across various Linux distributions.
Snaps (a "Snap package") are self-contained, sandboxed, and come with all the necessary dependencies, providing a consistent experience across different Linux distributions.
Installing Snap
On a Linux system, make sure you have the snapd service installed. snapd is the "snap daemon", which is needed to install and utilize snap packages.
snapd can be installed it using the following commands on Ubuntu systems:
sudo apt update
sudo apt install snapdInstalling the Metanorma snap package
The Metanorma snap package is aptly named metanorma.
To install the latest version of snap metanorma, run the following command in your shell:
sudo snap install metanormaThis command will download and install the latest package from the Snap Store.
Downgrading the Metanorma snap package
In some cases, you might need to downgrade to a specific version of metanorma.
Snapcraft makes this process straightforward.
List installed versions
First, list the available versions of the metanorma snap package using the following command:
sudo snap list metanorma --allIf you have several metanorma versions installed before you will get an output similar to this:
Name Version Rev Tracking Publisher Notes
metanorma 1.7.3 212 latest/stable metanorma disabled,classic
metanorma 1.8.1 216 latest/stable metanorma classicRevert to a previous version
sudo snap revert metanormaRevert to a specific previous version
sudo snap revert metanorma --revision 212List available versions
snap info metanormaUninstall
To uninstall the metanorma snap package from your system, use the following command:
sudo snap remove metanormaConclusion
When using the Snap version of metanorma on Linux, the benefits of the Snapcraft approach are evident -- simplified installation, version management, and distribution of software.
While the downgrade process may not be the most straightforward, it is never further than a couple command presses!