Differences Between Snap, AppImage, and Flatpak

Differences Between Snap AppImage and Flatpak

If you have used operating systems like Windows then migrated to Linux, you will realize that installing apps and software on Linux can be quite hectic, especially if you don’t know the right method to install specific software on a certain Linux distribution.

Since Linux is free and open-source, there is so much software available for Linux systems. You have probably come across the terms like Snap, AppImage, and Flatpak. These are some of the popular formats used when installing software in Linux systems.

In this post, we will look at the differences between these three package formats – Snap, AppImage, and Flatpak.

Why Do You Need Snap, Flatpak, and AppImage?

Earlier, developers who wanted to distribute applications for various Linux distributions faced many challenges regarding packaging. That was because of the many Linux distributions in the market, and all use different package management systems.

For example, Ubuntu and any other Debian-based distros use the .deb package extension while Fedora, CentOS, RHEL use the .rpm package extension. That also applies to the command-line (CLI) package managers. In addition, Debian-based distributions use APT, while RHEL-based distributions use DNF. Therefore, a good name for these packages (dnf, rpm, etc.) would be distribution-dependent package formats. Therefore, developers had to package their apps as per the target distribution – Application_One.deb, Application_One.rpm, etc.

To make the whole process of developing and packaging software for Linux systems much easy and fast, developers built distribution-independent package formats. They include Snap, Flatpak, and AppImage. Therefore, any application distributed by these package formats can run on any Linux system supporting these frameworks.

So let’s dive in and explore each of the package formats.

Snap

Snap is a package manager developed and maintained by Canonical and first released in 2014. Snap is one of the best alternative package managers for Debian-based distribution like Ubuntu etc. Other than being a package store, it also supports a command-line interface to install packages. For example, to install the Brave browser with snap, execute the command below:

sudo snap install brave

It was initially developed for Ubuntu but has easily been adopted by other Linux distributions, including Arch, Linux Mint, CentOS, Gentoo, and Fedora. These distributions have also included support for the Snapcraft framework. To easily maintain packages, Snap uses a central package repository for all snap applications.

Snap has an online app store (Snapcraft) where users can find and install applications. That is quite an advantage to the users as they have one large pool to search for any software packages they need. Snapcraft is also maintained and controlled by canonical.

word image 1

Additionally, the Snapcraft framework enables developers to develop their packages and upload them to the Snap store. You can see these guidelines at the bottom of the Snapcraft page. – How to snap an app in 30 minutes.

Flatpak

Flatpak was developed by a Red Hat employee – Alexander Larsson, and officially released in 2015. It is developed in C programming and offers a quick and straightforward way to install applications on your Linux distributions.

Flatpak works by combining and compiling an application into one single package. Previously, Flatpak was known as xdg-app. This particular framework uses the concept of running applications in a sandboxed environment without the need for root privileges. Therefore, some flatpak apps can’t access and utilize the system’s total resources.

Flatpak applications targeted primarily three desktop environments – FreeDesktop, KDE, and GNOME. Unfortunately, Flatpak doesn’t support any back-end tools as it only produces applications to run on a Desktop environment. That is one major disadvantage for this package manager as it doesn’t support servers unless you install a Desktop Environment (DE) like GNOME.

Similar to Snap, Flatpak has an online store called Flathub, where users can find and download applications they want. When first released, Flathub only allowed developers to publish free and open-source applications. However, after updating their terms and conditions, developers can now publish even proprietary packages.

word image 2

AppImage

This package format was developed by Simon Peter and first released into the market with the name Kik. AppImage makes use of the same concept as Java programming – “write once – run everywhere” or “one app – one file.”

An AppImage package contains the application itself and all the dependencies it requires to run. Once you download the file, say balena-etcher.AppImage, you don’t need to install the files. Just assign it the correct permissions to make it executable, then run it. For example, to run the balena-etcher.AppImage file, I would use the commands below:

sudo chmod +x balena-etcher.AppImage
./balena-etcher.AppImage

Like Snap and Flatpak package formats, AppImage also has an online repository to find and download AppImage packages – AppImage website.

To update an AppImage package, you will need to look at the update guide provided when downloading the file. Alternatively, you can use the AppImage Updater or download the new version of the app. AppImages can run on Arch Linux, Centos, Debian, Fedora, OpenSUSE, Red Hat Linux, and Ubuntu.

word image 3

Comparison: Snap vs. Flatpak vs. AppImage

We have looked at what these are package formats are and why we need them. Now let’s have a head-to-head comparison between the three – Snap, Flatpak, and AppImage.

Permission controls

Most Linux apps need to access different resources in the system to give you the utmost performance. Luckily, these package formats allow you to set these permissions and decide what the app accesses and what it shouldn’t.

Snap

Snap provides users with both a graphical and command-line method to assign permission. To assign permissions graphically, launch Ubuntu Software Center and look for the installed app that you want to manage. Then, click on the Permissions button next to the remove button.

word image 4

In the image above, we can see the current permissions assigned to the Leafpad application. You can decide to enable or disable by clicking the toggle button next to each permission.

Alternatively, if you are a command-line person, use the snap connections argument to view the set permissions. For example, to view permissions assigned to the Leafpad app, we will use the command below:

snap connections leafpad
Interface               Plug                     Slot                              Notes
avahi-observe           leafpad:avahi-observe    -                                 -
content[gtk-2-engines]  leafpad:gtk-2-engines    gtk2-common-themes:gtk-2-engines  -
content[gtk-2-themes]   leafpad:gtk-2-themes     gtk-common-themes:gtk-2-themes    -
content[icon-themes]    leafpad:icon-themes      gtk-common-themes:icon-themes     -
cups-control            leafpad:cups-control     -                                 -
desktop                 leafpad:desktop          :desktop                          -
desktop-legacy          leafpad:desktop-legacy   :desktop-legacy                   -
gsettings               leafpad:gsettings        :gsettings                        -
home                    leafpad:home             :home                             -
mount-observe           leafpad:mount-observe    -                                 -
network                 leafpad:network          :network                          -
removable-media         leafpad:removable-media  -                                 -
x11                     leafpad:x11              :x11                              -

To grant permissions to our app, we will just pick the particular permission and use the snap connect command as shown below:

snap connect leafpad:mount-observe

To remove permissions, use the snap disconnect command:

snap disconnect leafpad:mount-observe

Flatpak

Flatpak also provides both a graphical and a command-line method to assign permissions to Flatpak apps. We will use the GNOME software for the graphical method by clicking the Permissions button on the particular package.

To see permissions assigned to a Flatpak via the terminal, use the command below:

flatpak info --show-permissions com.github.jeromerobert.pdfarranger

Remember to replace com.github.jeromerobert.pdfarranger with the name of your Flatpak package. To get a list of all Flatpak packages on your system, execute the command below:

flatpak list

AppImage

As of writing this post, AppImage doesn’t provide users with a way of assigning and removing permissions. However, developers have hinted they might include this feature in the future.

Sandboxing

Sandboxing refers to a situation where an application runs in a contained environment fully isolated from the host. Any interaction with the host resources s achieved by the use of APIs and permissions discussed above.

Snap uses modified AppArmor to sandbox applications, while Flatpak makes use of Namespaces. AppImage packages are not sandboxed and do not require sudo (root) privileges to run.

App Portability

When we talk of portability, we mean how easy you can to share the app from one system to another or even upload the file to the cloud. The only package manager that wins at this point is AppImage. For the other package formats, Snap and Flatpak, you will need to package the app itself, and including the child dependencies it relies on.

Unfortunately, the whole packaging process is not easy and requires the execution of various commands.

Native Theme Support

All the three package formats, Snap, Flatpak, and AppImage, support the native look and feel of GTK and Qt applications but with some small limitations.

For example, Snap and Flatpak apps are packaged with the system themes to achieve the correct system look and feel. Therefore, if you are tunning third-party themes and icons, the graphical interface of your Snap or Flatpak app might look a little off. Maybe the text, icons, or cursor might not be what you desire. That cannot be regarded as a critical issue as there have been major improvements over time.

However, there are always some notable differences in various applications.

Below is a comparison table of the differences between these three package formats.

Features Snap Flatpak AppImage
Permission Controls Yes Yes No
Sandboxing Yes Yes Yes
Mandatory Sandboxing Yes Yes No
Reliable Portability No No Yes
System Theme Support Yes (with caution) Yes (with caution) Yes (with caution)
Includes Bundled Libraries Yes Yes Yes
Wholy contained – single executable package No No Yes
Online Software/App store Yes Yes Yes
Apply updates automatically Yes Yes Yes (With caution)
ChromeOS (Chromebooks) support Yes Yes Yes
Number of Apps available in the online store Highest number Lowest Average

Final Insights

I believe this post has given you a good understanding of the distribution-independent package formats we have today – Snap, Flatpak, and AppImage. Even though every Linux distro comes with its package manager, e.g., apt for Ubuntu), these third-party package formats have proved to be much efficient and reliable.

As a result, you have access to many more apps available for other distributions. Also, users who are not well-versed with Linux systems can easily install apps using these package formats (especially AppImage) without executing multiple commands to install required dependencies.

 

0 Shares:
Subscribe
Notify of
guest
Receive notifications when your comment receives a reply. (Optional)
Your username will link to your website. (Optional)

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Chris
2 years ago

I’m curious how this compares nearly a year later. The number of available packages could also be split between open source and proprietary.

You May Also Like
Bash While Loop
Read More

Bash While Loop

In almost all programming languages, a loop is an easy and basic method used to repeat single or…