unsnap, an excellent tool to migrate Ubuntu from Snap to Flatpak

unsnap

unsnap, a tool to migrate snap packages to flatpak

Snap is a package system developed by Canonical. for Ubuntu and can be implemented on operating systems that use the Linux kernel and the systemd init system.

This package systems is presented as a "universal" system, which Canonical has promoted a lot to such a degree that in the new versions that are designed for Ubuntu it has left aside the support of Flatpak and thus bet everything for everything for its package system.

On the other hand also Canonical has made the decision to release a version of Ubuntu entirely on Snap. This is news that was not liked by many and has generated a division in the community, since Snap packages are not fully accepted.

Before it Various movements have emerged in order to give a plus for the use of Flatpak packages. One of the projects supporting the Flatpak format is unsnap, which is developed as a tool to convert Ubuntu-based systems from using snap packages to flatpak packages.

The utility not only replaces the snap package manager with flatpak, but also selects and installs flatpak counterparts for snap packages already installed on the system. In the ideal case, the user can get a completely similar set of applications, but installed in flatpak format.

about unsnap

The migration is done in several steps. In the first step, unsnap generates a set of shell scripts that describe the replace operations. Taking into account the current state of the system, separate scripts are created to backup the snap environment, install the flatpak package manager, activate flatpak repositories, install flatpak analogs for snap packages already on the system, remove snap packages and the snapd system toolkit. Before executing the automatically generated scripts, the user can edit them to their liking.

The project isis being developed by Alan Pope, one of the developers of the Snap system, who left Canonical in 2021 after 10 years with the company. The toolset is still positioned as experimental (pre-alpha) and is limited to Ubuntu support.

Of the related projects, the unsnap author mentions custom-desktop (a set of scripts for converting the composition of an already installed Ubuntu environment) and deb-get (an analogue of apt-get for working with deb packages located in third-party repositories or on websites).

In addition to the package manager, the deb-get project provides ready-to-install third-party package metadata that can be used to replace snap packages with deb packages.

Unsnap can automatically run a set of scripts are generated:

  • 00-backup : Run snap save for each installed snap that is being migrated
  • 01-install-flatpak : If it is not already installed, it will install the flatpak package manager
  • 02-enable-flathub : if not enabled, will add the flathub remote location in flatpak
  • 03-install-flatpaks : installs equivalent flatpaks for each identified plugin
  • 04-remove-snaps : removes snaps for which flatpaks have been installed
  • 99-remove-snapd : removes snapd alone, which will remove all snap packages

It is mentioned that in the future, unsnap plans to support other snap-compatible distributions, such as Manjaro, Linux Mint, Zorin, Debian, Fedora, Pop_OS!, KDE Neon, Raspbian, CentOS, and Elementary OS. Users may also be interested in the list of analog packages prepared by the project in snap and flatpak formats.

How to install unsnap on Ubuntu?

For those interested in being able to install this tool on their system, they should know that the installation is quite simple and it is enough to open a terminal and in it they will type the following:

git clone https://github.com/popey/unsnap
cd unsnap
./unsnap

Unsnap works as a two-stage process. Initially, Unsnap generates a set of scripts that are responsible for executing the migration real from snap packs to flatpak. This feature allows users to view and, if necessary, edit the scripts before execution to validate or modify them according to their needs.

After the scripts are generated, users can run them in sequence to complete the migration process.

Or, as mentioned at the beginning, if you prefer the execution of all the scripts, just type:

./unsnap auto

Finally, it is worth mentioning that like any migration process, the recommendation is made to make a backup of important information, since as such it is removing and installing applications, which also entails removing information.

If you are interested in learning more about it, you can check the details at the following link.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.