search
HomeSystem TutorialLINUXHow To Migrate From Snap Packages To Flatpak Using Unsnap In Ubuntu

Are you looking to make the shift from using snap packages to flatpaks? If so, you're in the right place! In this article, we're going to introduce you to a fantastic tool called Unsnap, which simplifies the process to migrate from Snap packages to Flatpak in Ubuntu and its derivatives.

Table of Contents

What is Unsnap?

Unsnap is a shell script that enables a quick and easy transition from using snap packages for applications to flatpak. As its name suggests, Unsnap is all about assisting users to 'unsnap' or detach themselves from snap packages and migrate towards using flatpak.

Developed by Former Snap co-developer Alan Pope, Unsnap allows users to seamlessly migrate from using snap for applications to flatpak in Ubuntu and Ubuntu-based systems.

The Unsnap is licensed under the MIT license, which means it's free and open-source.

How does Unsnap Work?

Unsnap operates as a two-stage process. Initially, Unsnap generates a set of scripts that are responsible for executing the actual migration from snap packages 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 generating the scripts, users can run them in sequence to complete the migration process. The procedure is pretty straightforward: clone the Unsnap repository, navigate to the Unsnap directory, and run the Unsnap command. For users who prefer to skip manual steps, there's an 'auto' option, which automatically generates and runs the scripts.

How to Migrate from Snap to Flatpak using Unsnap

Running Unsnap is a straightforward process. All you need to do is clone the GitHub repository and run the unsnap command. This action will generate a set of scripts. You then run these generated scripts in sequence to achieve unsnappyness. Alternatively, you can run unsnap with the auto option to generate and run the scripts immediately.

Here's a step-by-step process to replace Snap packages with Flatpaks using Unsnap:

First, clone the repository:

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

Change directory to the cloned repository:

$ cd unsnap

Run the unsnap command:

$ sudo ./unsnap

Or run unsnap with auto option:

$ sudo ./unsnap auto

How To Migrate From Snap Packages To Flatpak Using Unsnap In Ubuntu

This will take a while depending on the number of installed Snaps on your system. Please be patient!

Upon successful flatpak migration, you would see an output something like below:

[...]
INFO: flatpaks installed
<strong><mark>INFO: These flatpaks are now installed:
Freedesktop Platform	org.freedesktop.Platform	22.08.12.1	22.08	system
Mesa	org.freedesktop.Platform.GL.default	23.1.1	22.08	system
Mesa (Extra)	org.freedesktop.Platform.GL.default	23.1.1	22.08-extra	system
openh264	org.freedesktop.Platform.openh264	2.1.0	2.2.0	system
Firefox	org.mozilla.firefox	114.0.2	stable	system</mark></strong>
INFO: Removing snaps
<strong><mark>firefox removed</mark></strong>
INFO: Snaps removed
WARNING: These snaps are still installed:
Name                       Version           Rev    Tracking         Publisher    Notes
bare                       1.0               5      latest/stable    canonical**  base
core20                     20230613          1950   latest/stable    canonical**  base
core22                     20230612          766    latest/stable    canonical**  base
gnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -
gtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -
snap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -
snapd                      2.59.5            19457  latest/stable    canonical**  snapd
snapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -

How To Migrate From Snap Packages To Flatpak Using Unsnap In Ubuntu

The output above shows that the Firefox Snap application has been uninstalled and subsequently replaced with its Flatpak version.

Here is the list of installed Snaps before running Unsnap in my Ubuntu 22.04 LTS system:

$ snap list 
Name                       Version           Rev    Tracking         Publisher    Notes
bare                       1.0               5      latest/stable    canonical**  base
core20                     20230613          1950   latest/stable    canonical**  base
core22                     20230612          766    latest/stable    canonical**  base
firefox                    103.0-1           1589   latest/stable/…  mozilla**    -
gnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -
gtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -
snap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -
snapd                      2.59.5            19457  latest/stable    canonical**  snapd
snapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -

How To Migrate From Snap Packages To Flatpak Using Unsnap In Ubuntu

And here is the output of snap list command after the Snaps are migrated to Flatpaks.

$ snap list 
Name                       Version           Rev    Tracking         Publisher    Notes
bare                       1.0               5      latest/stable    canonical**  base
core20                     20230613          1950   latest/stable    canonical**  base
core22                     20230612          766    latest/stable    canonical**  base
gnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -
gtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -
snap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -
snapd                      2.59.5            19457  latest/stable    canonical**  snapd
snapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -

See? The Snap version of Firefox is removed.

What Scripts does Unsnap Generate?

As stated already, Unsnap generates a series of scripts to facilitate the migration process. Each script performs a specific function.

Here's a brief overview of the scripts generated by Unsnap and their functions:

  1. 00-backup: This script runs the snap save command for each installed snap being migrated. This ensures that you have a backup of all your data before proceeding with the migration.
  2. 01-install-flatpak: If not already installed, this script installs the flatpak package manager on your system.
  3. 02-enable-flathub: This script adds the remote flathub location in flatpak if it's not already enabled.
  4. 03-install-flatpaks: This script installs equivalent flatpaks for each identified snap package.
  5. 04-remove-snaps: After the successful installation of flatpaks, this script removes the corresponding snaps.
  6. 99-remove-snapd: This script removes snapd itself, which in turn removes all snap packages from your system.

Package Mapping

One of the key features of Unsnap is its 'Package Mapping' capability. Unsnap ships with a file named 'applist.csv' that contains a mapping of snap package names to flatpak names. This one-to-one mapping, although not entirely complete, covers a substantial subset of applications available in the snap store and flathub.

Check Mode

To facilitate the checking of snap and flatpak names in the 'applist.csv' file, Unsnap has a 'Check Mode'. This mode allows users to verify the accuracy of the mapping between snap packages and flatpaks, ensuring a smooth migration process.

Please note that in the "Check" mode, the Unsnap program doesn't generate any scripts, alter any data, or install any Flatpaks. Instead, it creates an unsnap.logfile for reference and tracking.

Application Data

Currently Unsnap executes a snap save for each snap that's being migrated. This operation leverages snapd's internal mechanism to create backups of application data. It's essential to ensure sufficient disk space and time for this process, considering that some applications might have substantial data to backup.

You can find more details about snap save in the snap snapshots documentation.

If you prefer to skip the backup, simply avoid running the backup scripts before initiating the actual migration.

By default, the backups created with snap save are stored as zip files in the /var/lib/snapd/snapshots directory.

At the moment, the task of restoring the data, if needed, is left to the user.

Logging

Unsnap provides output both to the console and to a log file. The log file, named unsnap.log, is located in the ./log-YYYY-MM-DD.HH.MM.SS subdirectory of the current directory where Unsnap is being run.

Excluded Snaps

The excluded_snaps.txt file contains a list of snaps that don't have direct equivalents on Flathub. This list includes snaps like bare, core18, and core20. As such, it's not beneficial to prompt users to migrate from these particular snaps to another Flatpak.

It's worth noting that while there are conceptually similar packages available on Flathub, these are automatically included during the installation of relevant applications and do not require handling by Unsnap.

The role of excluded_snaps.txt is not to catalogue packages that have not yet been made available as a Flatpak, but rather to identify packages that will likely never be converted to a Flatpak.

The following is the list of excluded Snaps in my Ubuntu 22.04 LTS system:

bare
canonical-livepatch
core
core18
core20
core22
gnome-3-28-1804
gnome-3-34-1804
gnome-3-38-2004
godot-runtime
gtk-common-themes
gtk2-common-themes
kde-frameworks-5
qt513
qt551
snapd
wine-platform-3-stable
wine-platform-5-stable
wine-platform-6-stable
wine-platform-runtime

Project Status

As of now, Unsnap is in its pre-alpha stage. This means that it has been tested and has shown promising results on the developer's computer. However, unless you're planning on contributing to the project, it's probably not ready for you yet. It's a work in progress, and contributions to improve its functionality and versatility are most welcome!

Frequently Asked Questions

Here's the FAQ about Unsnap.

Q: What is Unsnap?

A: Unsnap is a tool designed to help users migrate from using Snap packages to Flatpak. It works by generating scripts that handle the migration process, which users can review and modify before execution.

Q: Who is the developer of Unsnap?

A: Unsnap was developed by Alan Pope, a former co-developer of Snap. Pope was with Canonical, the parent company of Ubuntu, for 10 years before leaving in 2021. After his departure, he created Unsnap to help users migrate from Snap packages to Flatpak.

Q: How do I use Unsnap?

A: To use Unsnap, you need to clone the GitHub repository and run the unsnap command. This action will generate a set of scripts. You then run these generated scripts in sequence to migrate from Snap to Flatpak.

Q: What are the generated scripts?

A: Unsnap generates a series of scripts to facilitate the migration process. They include scripts for backing up your Snap data, installing Flatpak, enabling Flathub, installing equivalent Flatpaks, and removing the original Snaps and snapd.

Q: What is the 'check' mode?

A: The 'check' mode is a feature of Unsnap that allows you to verify the Snap and Flatpak names in the applist.csv file without making any changes to your system or installing any Flatpaks. It also generates an unsnap.logfile.

Q: What is the 'applist.csv' file?

The 'applist.csv' file in Unsnap contains a mapping of Snap package names to Flatpak names. This facilitates the one-to-one mapping between the two, aiding the migration process.

Q: What is the 'excluded_snaps.txt' file?

The 'excluded_snaps.txt' file lists Snap packages that do not have direct equivalents on Flathub, such as bare, core18, and core20. Unsnap will not prompt users to migrate these particular packages.

Q: Is Unsnap ready for use?

A: As of now, Unsnap is in its pre-alpha stage. While it has shown promising results on the developer's computer, it might not be ready for general use yet unless you're planning on contributing to the project.

Q: Is Unsnap open-source?

A: Yes, Unsnap is open-source and licensed under the MIT license. This allows anyone to use, modify, and distribute it under the same license.

Conclusion

Unsnap is an excellent tool for users looking to migrate from snap packages to flatpak. It's still in the pre-alpha stage, meaning it's in the early stages of development and might not be fully ready for all users. Use it with caution!

Resource:

  • Unsnap GitHub Repository

Related Read:

  • Linux Package Managers Compared – AppImage vs Snap vs Flatpak

The above is the detailed content of How To Migrate From Snap Packages To Flatpak Using Unsnap In Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are the differences in how Linux and Windows handle user authentication?What are the differences in how Linux and Windows handle user authentication?Apr 30, 2025 am 12:03 AM

The main difference between Linux and Windows in user authentication is that Linux uses PAM modules, while Windows relies on Active Directory and local security policies. 1. Linux provides flexible authentication configurations through PAM, such as passwords, fingerprints, etc. 2. Windows realizes centralized management and enterprise network integration through Active Directory.

How to Install and Run FreeDOS on Linux Using QEMUHow to Install and Run FreeDOS on Linux Using QEMUApr 29, 2025 am 10:36 AM

This guide shows you how to set up the free and open-source DOS-compatible operating system, FreeDOS, within a Linux environment using the QEMU emulator. This allows you to run legacy DOS software and games on modern hardware without needing a separ

How to Install KDE Plasma on Linux Mint 22How to Install KDE Plasma on Linux Mint 22Apr 29, 2025 am 10:10 AM

Linux Mint, an operating system known for its simplicity, stability and ease of use, is popular with users and is especially suitable for beginners. It uses the Cinnamon desktop environment by default, providing a simple and friendly user interface. But if you prefer a different look or need more customization options, you can install other desktop environments such as KDE Plasma. KDE Plasma is a feature-rich, highly customizable and visually excellent desktop environment that provides a modern and stylish user experience. It has a wide range of customization options, advanced window management capabilities and sophisticated aesthetics, perfect for users who want to have a better control over the desktop experience. This guide will guide you step by step to install KDE Pl on Linux Mint 22

How to Reduce High RAM & CPU Usage on LinuxHow to Reduce High RAM & CPU Usage on LinuxApr 29, 2025 am 10:05 AM

Linux system performance optimization: Reduce RAM and CPU usage Linux systems are powerful and efficient, but high RAM and CPU usage can reduce performance, slow down applications, and even cause servers, workstations, or embedded systems to crash. Therefore, optimizing resource usage is crucial for the smooth operation of the system. This guide will explore practical ways to reduce RAM and CPU usage in Linux systems, covering monitoring tools, process management, kernel tuning and system optimization technologies to help you keep your system running efficiently. Identify resource-intensive processes The first step in reducing RAM and CPU usage is to identify which processes consume the most resources. To do this, you can use the following command-line tools: a. Use top

How to Boot Into Single User Mode in AlmaLinux 8/9How to Boot Into Single User Mode in AlmaLinux 8/9Apr 29, 2025 am 09:46 AM

Single User Mode (also known as Rescue Mode) Guide for AlmaLinux 8 and 9 Single-user mode is a streamlined Linux environment that allows system administrators to perform maintenance tasks, troubleshoot problems, and recover from system failures. Single-user mode is especially useful when you need to reset your root password, fix configuration errors, fix corrupt file systems, or investigate system errors that prevent normal startup. As RHEL-based distributions, AlmaLinux 8 and 9 provide an easy way to enter single-user mode via the GRUB boot loader. This guide will explain step by step how to enter single-user mode on AlmaLinux 8 and 9. What is single use

Linux Troubleshooting: 5 Common Problems & How to Fix ThemLinux Troubleshooting: 5 Common Problems & How to Fix ThemApr 29, 2025 am 09:42 AM

Linux systems are known for their power and reliability, but even experienced users will encounter unexpected problems. Whether it is an unexpectedly deleted file, a forgotten root password, or a slow system running, efficient troubleshooting skills are the key to becoming a Linux expert. This guide will introduce common Linux problem solving scenarios and step-by-step solutions that are common among system administrators, developers, and everyday Linux users. Scene 1: Unexpected deletion of important files You accidentally deleted an important file using the rm command and now you need to restore it. Unlike Windows and macOS, Linux does not have a built-in "recycle bin" to store files deleted from the terminal. Recovery options depend on

How to Permanently Change Docker Folder Permissions on LinuxHow to Permanently Change Docker Folder Permissions on LinuxApr 29, 2025 am 09:35 AM

Docker is a powerful tool that allows you to run applications in an isolated environment called containers. However, sometimes you may need to change the permissions of the Docker folder to ensure that your application has access to the necessary files and directories. This article will guide you through the process of permanently changing Docker folder permissions on Linux systems. Understand Docker folder permissions By default, Docker stores its data, including images, containers, and volumes, in specific directories on Linux systems. The most common directory is /var/lib/docker. The permissions of these folders determine who can read, write, or execute the files in it. if

Manage Docker Like a Pro: Install Portainer CE on LinuxManage Docker Like a Pro: Install Portainer CE on LinuxApr 29, 2025 am 09:24 AM

Simplify Docker Management with Portainer CE on Linux: A Step-by-Step Guide Managing Docker containers via the command line can be daunting, especially for newcomers. Portainer CE (Community Edition) offers a free, lightweight, and intuitive solutio

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools