Skip to content

Ex-Snap Advocate at Ubuntu Creates a Tool to Help You Migrate from Snap to Flatpak

Don’t like using Snap?

Well, you can always stick to the traditional binary packages (deb/rpm) or opt for Flatpak.

But, what if you already rely on apps from the Snap store?

It will be time-consuming to manually remove the apps, get rid of Snap, install Flatpak, and install all the Flatpak packages.

That’s where “Unsnap” comes to the rescue.

Unsnap is an open-source utility developed by a former Snap advocate at Canonical, Alan Pope to help you quickly migrate from using snap packages to Flatpaks.

Unsnap: Here’s How it Works

Note that the utility is still in its pre-alpha phase, you can test it out, but you may want to do some research if you want to help improve it and try it for yourself.

Basically, the tool generates scripts to help you do the following (in the particular order):

  • Backup existing Snaps.
  • Install Flatpak (if not already present).
  • Enable Flathub.
  • Install the Flatpaks for the same Snap applications.
  • Remove Snap applications for the Flatpaks installed.
  • Remove all Snaps.

While the scripts are generated automatically when you run the tool, you can choose to run those scripts manually or automatically one-by-one to switch away to Flatpaks.

How to Test Unsnap?

unsnap

You might have a vague idea of how it’s achieved looking at the screenshot above. You can also refer to its GitHub page for the latest information.

For reference, let me highlight the steps for you:

1. Clone the GitHub Repository

Make sure you have Git installed on your Linux distro. Once done, you can type in the following command:

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

2. Navigate to the directory

Once you clone the repo, you will have the unsnap directory on your system.

Navigate to the directory by typing in:

cd unsnap

3. Run the Tool

After navigating to the target directory, simply run the unsnap utility using the command:

./unsnap

It will check for existing snaps, Flatpaks, and more to set things up.

As you can notice in the screenshot above, it already detects that my system has Flatpak setup, so it skips generating the scripts for those tasks.

In the process, it also learns about the Snap packages installed on your system to find equivalent Flatpaks when you run the generated scripts.

If you want to run all the scripts immediately, you can type in:

./unsnap auto

If you want to take control without the auto option, you can find the scripts generated reside inside a log directory, as shown in the image below:

unsnap

Here’s the order of the scripts that you should follow:

  • 00-backup
  • 01-install-flatpak
  • 02-enable-flathub
  • 03-install-flatpaks
  • 04-remove-snaps
  • 99-remove-snapd

In my example, I already have Flatpak set up, so I proceed with running the backup script, and then installing the Flatpak, so on. Here’s how it looks like:

You should keep in mind that this tool is under heavy development and may not work as expected. So, you if you rely on numerous Snap packages, you should experiment using the tool in a virtual machine or a test machine and wait for the tool to improve with a stable release.

Let me know your thoughts on Unsnap in the comments below.


More from It's FOSS...

Latest