Snap vs. AppImage vs. Flatpak: What Is the Difference and Which Is Best for You? - MUO - MakeUseOf
Linux systems are popular for many reasons, but installing applications is not one of them. Apps in Linux are delivered as packages and come in all sorts of flavors. Packaging systems differ in terms of installation, usability, and update mechanisms.
Below, we'll look at and compare three prominent package formats: Snap, AppImage, and Flatpak, all distro independent.
What Are Package Formats?
Package formats are archives that contain program code and the metadata needed to run them. Linux supports several package formats, and developers may choose to package their app in any format they want. As a user, you'll need to download the required package and install it via a package manager to run the application.
Ubuntu and other Debian-based distros[1] use the .deb package format natively, while Fedora, RHEL, and CentOS use .rpm. Native packages are fast as they are designed and compiled specifically for a system, and they also share libraries, keeping apps smaller. However, native packages require users to update and maintain dependencies themselves.
Distro independent packages like Snap, AppImage, and Flatpak provide apps that can run on different machines. They take away the dependency issues many Linux users face every day and make life a lot easier for developers. However, this also results in larger binaries.
Snap vs. AppImage vs. Flatpak
As stated above, all three of Snap, AppImage, and Flatpak provide means for packaging apps independent of the Linux distribution. Let's take a close look at some of their notable features as well as pros and cons.
1. Snap
Snap is a packaging system developed by Canonical and has significant corporate backing. When you install the snap version of an app, it includes all the libraries and dependencies required to run that app. This saves app maintainers the time needed to roll out different builds for different systems.
You can install snaps from the Snap Store[2] directly or via the command line. Many popular Linux distros have adopted Snap, including Ubuntu, Manjaro, Linux Mint, Debian, Kali, and RHEL. Another key benefit of Snap apps is that they also run on IoT and Cloud systems without modifications.
Snaps also allow users to have multiple versions of the same app. The self-updating nature of snaps makes sure users don't have to worry about manual updates. However, since snap packages contain all the necessary dependencies, they are bulkier than vanilla .deb or .rpm packages. Plus, the snap version of many apps runs slower than AppImages or Flatpaks.
Below are some snap commands that can be useful if you're just starting with them. The function of each command is listed as comments.
# install VLC Media Player
snap install vlc# list installed snaps
snap list# update VLC Media Player
snap refresh vlc# revert VLC Media Player to the prior version
snap revert vlc# remove VLC Media Player
snap remove vlc
2. AppImage
AppImage is a great way to try out new apps without installing them on your machine. The concept behind AppImage is fairly simple: one file per app. This way, developers can ensure the portability of their apps, and users get to try out new packages without installation. A major advantage of AppImages is that they don't require sudo permissions in Linux[3].
To try out an AppImage, all you need to do is download the package, make it executable, and run it. It's similar to how .exe files work in Windows.
AppImageHub[5] is the central repository for AppImage packages and contains many popular apps. You can also download AppImages from vendor websites if provided. But stay away from AppImages downloaded from an untrusted source.
AppImages are usually faster than snaps or flatpaks and need less storage space. They are also easy to remove as you can delete AppImage files anytime you want without interrupting other system processes.
Below are the commands needed to run an AppImage file in Linux from the command line:
# grant execute permission to the file
chmod a+x *.AppImage # execute the AppImage
./*.AppImage
3. Flatpak
Flatpak is another distro agnostic packaging system that ships apps with required dependencies. Users can find and install flatpaks from the distribution store of popular Linux systems or via the CLI.
Flatpak is a decentralized system, meaning you can obtain packages from several repos or remotes (in Flatpak terms). Flathub[6] is the most popular remote and has thousands of apps.
Flatpak apps run in a sandbox by default, an application environment separate from the host system's runtime. This sandbox includes everything needed to run the software. The isolated nature of Flatpak packages makes them inherently secure, and system changes can only occur if the user provides explicit permission.
However, Flatpak packages usually take up more space than Snaps or AppImages. They are also slower compared to AppImages but faster than Snap packages. Flatpak is installed by default on modern Linux distros. If that's not the case, you can install it using the following commands:
On Ubuntu/Debian:
sudo apt install flatpak
On Arch Linux:
sudo pacman -S flatpak
On Fedora, RHEL, and CentOS:
sudo dnf install flatpak
You can add the Flathub repo to your system using the below snippet:
flatpak remote-add --if-not-exists flathub \ https://flathub.org/repo/flathub.flatpakrepo
Use the flatpak install command to install packages. The below command installs the VLC flatpak from Flathub:
flatpak install flathub org.videolan.VLC
Snap vs. AppImage vs. Flatpak: Which Way to Go?
Since all three package formats are OS-independent, you can choose to use any one of them. However, there are scenarios where each one outperforms the others. For example, if application speed and program size matter to you the most, then AppImage would be the ideal solution.
But if you want to run your application across different platforms, Snaps should be the way to go. Flatpaks, on the other hand, offers more control to the developers. So, if you're a developer, you may choose Flatpak over Snaps. Availability of apps is also an important factor when choosing between Snap, AppImage, and Flatpak.
Best Distro-Independent Packaging System for Linux
Distro-independent packages are a great way to ensure software portability. All three of Snap, AppImage, and Flatpak have something unique to offer for end-users. Even so, it's up to you which one you want to use. Better yet, try out some of the best Linux apps from all three realms and see what works for yourself.
Read Next
[7] About The AuthorReferences
- ^ other Debian-based distros (www.makeuseof.com)
- ^ install snaps from the Snap Store (www.makeuseof.com)
- ^ sudo permissions in Linux (www.makeuseof.com)
- ^ Can Linux Run Windows EXE Files? (www.makeuseof.com)
- ^ AppImageHub (www.appimagehub.com)
- ^ Flathub (flathub.org)
- ^ The Best Linux Software and Apps Whether you're new to Linux or you're a seasoned user, here are the best Linux software and apps you should be using today. Read Next (www.makeuseof.com)
- ^ More From Rubaiat Hossain (www.makeuseof.com)
Komentar
Posting Komentar