Nick Francesco

Linux Stuff

Packaging Formats

Apt? Yum? Snap? Flatpak? AppImage?

Applications are available in all of these formats and more. Why is there more than one? Which one is best? Do I need them all?

In order to install applications in Linux, they need to be in a format that your version of Linux understands. For that, you need a package manager. Back in the day, each base distribution (distro) of Linux had their own proprietary package manager. Debian-based distros used apt; Red Hat-based distros used yum (originally rpm); etc. The package manager figured out what dependencies a program needed in order to run (in Windows, they're called DLLs, Dynamic Link Libraries), and made sure all of those dependencies were met by installing the additional programs needed along with the main application you wanted.

The problem is that various versions of applications often need different versions of the attendant dependencies. (In Windows, this is called DLL Hell) This could lead to a real nightmare of dependencies fighting each other and blocking a needed dependency from being loaded by a particular application. Sorting it all out could prove well nigh impossible.

The big solution to all this was a file format that took an application and all of its dependent files and compressed them down into a single file you could download onto your system. When you run an application that's been packed in this way, you run it with all of the dependencies it needs in a container separate from everything else (called a sandbox), and if you're also running a different package with different dependencies, they won't interfere with each other, because each one is running in its own little sandbox. So, to make application installation easier for the end user, Linux distributions started using these packaging standardizations in lieu of the traditional method of application installation.

Of course, as we all know, the beautiful thing about standards is that there are so many of them. Ubuntu (or rather their parent company, Canonical) created the Snap format; Red Hat created the Flatpak format; Peter Simon independently created the AppImage format; you can see where I'm going with this.

All of them support sandboxing, although only Flatpak makes sandboxing mandatory, which theoretically means they're safer. All of them can run without Super User (root) access after they're installed. All of them play nicely with whatever system they're on. All of them have support for fully bundled libraries. All of them have their own online app store. All of them will run in the GUI.

Canonical, the people who created Ubuntu, are super hot for Snaps (not surprising; they invented them), while many programmers tend to prefer Flatpaks and AppImages, since they're more likely to be guaranteed to run on any Linux distribution without an exception.

In terms of app size, AppImage usually is the smallest, and Snap the biggest. But the big thing right now, at least, is that Snaps have the largest number of available applications. Again, mainly because Canonical is behind them.

The main disadvantages of Snaps is their size, and they're a bit slower to start up than Flatpaks or AppImages. The main disadvantages of Flatpaks is that they have very little support for servers; they have larger package sizes; and while startup time is faster than Snap, it's slower than AppImage. The biggest disadvantage of AppImages is the complete lack of updates. If you want a newer version of an AppImage, you download it and throw out the old one. Oh, and once you've downloaded an AppImage, you most likely have to make it executable.

So Which One Should I Use?

Let me simplify it for you: use whatever one came with your distro. People running Ubuntu-based distros can most easily run Snaps because the Snap manager is already installed; people running Red-Hat based distros can most easily run Flatpaks because the Flatpak manager is already installed. Some programs are only available as AppImages. So download them and go. But the fact is that you can use them all. So whichever format has the program you want, just install it. If you have to install one of the other managers, just do it. They don't interfere with each other.

Some Examples

The Basic Commands to Search for Software

apt search myfavoriteprogram
snap find myfavoriteprogram
yum search myfavoriteprogram
flatpak search myfavoriteprogram
for searching, you can also use keywords, like "paint" or "password":
snap find paint will find all the painting programs;
for AppImages, you'll just have to know where to find them on the Web.

The Basic Commands to Install Software

sudo apt install myfavoriteprogram
sudo yum install myfavoriteprogram
sudo snap install myfavoriteprogram
sudo flatpak install myfavoriteprogram
for the AppImage, just download it, make it executable, and double-click.

The Basic Commands to Remove Software

sudo apt purge myfavoriteprogram
sudo yum remove myfavoriteprogram
sudo snap remove myfavoriteprogram
sudo flatpak uninstall myfavoriteprogram
for the AppImage, just throw it in the trash.

The Basic Commands to Update Software

sudo apt update
sudo apt upgrade
(you need both, in that order)
sudo yum update
sudo snap refresh
sudo flatpak update
for the AppImage, just download the new version and throw the old one in the trash.

The Basic Commands to List Installed Software

apt list --installed
yum list available
snap list
flatpak list
for the AppImage, you just have to remember what you downloaded. Or look in the directory to which you downloaded it.

Of course, there are a lot of additional options for each of these commands. man snap (for example) will overwhelm you with options. But for basic installation, updating, removal, and listing of programs, the above commands are all you'll need.

Return to the Linux page


Subscribe to the Ask Nick! Newsletter - only $25.00 per year!     Leave feedback for Nick   Disclaimer