flatpak Snap

How to Install Flatpak, Snap and AppImage Apps in Linux

This article will explain how to install, remove and manage Flatpak, Snap and AppImage packages in Linux. These three packaging formats have been in development for the last few years and they provide distribution agnostic packages that can be installed on all major Linux distributions. A detailed comparison between these packaging formats is available here.

Installing and Managing Flatpak Packages

If you are using Ubuntu, its derivatives or other Linux distributions based on Ubuntu, you can run the following two commands to setup Flatpak packages:

$ sudo apt install flatpak

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

The second command adds the official Flathub repository that can be used to download and install Flatpak apps. It is possible to add other third party repositories by replacing the repository URL in the second command above. However, in general, you should stick to the default repository to avoid installing untested apps that may have security issues.

If you are using any other Linux distribution, follow this quick setup guide that covers installation instructions for over 25 Linux distributions.

Once you have completed Flatpak setup, you can go to the Flathub store to download any app of your choice. For instance, to install the Firefox Flatpak package, you can visit its listing on the Flathub store or search for it using the search bar on the Flathub website. Every listing on the Flathub page includes an installation command at the bottom of the page. You need to run this command in the terminal to install the package. Note that the command is the same for all Linux distributions. For the quoted case, you need to run the following command to install the Firefox flatpak package:

$ flatpak install flathub org.mozilla.firefox

Note that while installing a Flatpak package, you may be asked to install additional packages and dependencies. This is normal as Flatpak packages install necessary packages and libraries as needed.

To remove an installed Flatpak package, you need to run the following command (replace ID of the package):

$ flatpak uninstall org.mozilla.firefox

If you don’t remember the ID of the package, you can get it from the Flathub store listing page. Flatpak will also show you app suggestions if you only supply a partial name or ID. For instance, if you just use “firefox” in the above command, Flatpak will automatically present you with a choice to remove the Firefox package.

To update an installed Flatpak package, you need to run the following command (replace ID of the package):

$ flatpak update org.mozilla.firefox

To list all Flatpak packages installed on your Linux system, use the following command:

$ flatpak list

Many Linux distributions use Flatpak plugin in their software distribution app to facilitate easier installation and automatic updates. For more information on Flatpak usage, run the following two commands:

$ flatpak --help

$ man flatpak

Installing and Managing Snap Packages

Ubuntu, its derivatives and most other Linux distributions based on Ubuntu come with Snap support enabled by default. You can search for snap packages in the GUI software center app as well as install them from the command line. Snap packages can be searched on the Snap Store website as well. Every listing in the snap store shows a command to install the listed app.

To add Snap support to other Linux distributions, you may need to install the “snapd” package first (similar to the Flatpak setup explained above). Follow the snapd setup guide available here for over 25 Linux distributions.

Once you have finished installing snapd, visit any listing on Snap store and run the specified command listed on the page. For instance, to install Android Studio Snap, you will need to run the following command:

$ sudo snap install android-studio --classic

To remove a Snap package, use the following command (replace application name as needed):

$ sudo snap remove android-studio

To list all Snap packages installed on your system, use the following command:

$ snap list

Note that you cannot disable snap updates. They are automatically installed on your system at periodic intervals. You can however, reschedule them or temporarily hold updates. A detailed guide on managing Snap updates is available here.

To learn more about Snap packages, run the following two commands:

$ snap --help

$ man snap

Installing and Managing AppImage Packages

AppImage packages work similar to portable “exe” files you may have used on Windows. All you need to do is download an AppImage file and mark it executable to run the app. To make an AppImage file executable, run a command in the following format:

$ chmod +x file.appimage

Once marked executable, double click on the executable AppImage file to launch the app. To remove an AppImage file, simply delete it from your hard drive storage.

Similar to Flatpak and Snap, an AppImage store is also available. However, unlike Snap and Flatpak, developers who distribute their apps in AppImage format don’t often list them in this centralized store. AppImage files are mostly distributed through source code repositories or from application websites.

In some cases, AppImage files may prompt you to create a launcher that appears in application menus and on desktop as a shortcut. If you have opted to create a launcher, you may want to remove it after deleting an AppImage file. To do so, just visit the location specified below and delete the associated “.desktop” file.

$HOME/.local/share/applications/

Conclusion

Flatpak, Snap and AppImage packages have provided novel ways to distribute applications across all major Linux distributions. They provide better security and make it easier for developers to distribute their apps. These new package formats are the future of Linux application packaging, especially for non-system third party apps.

About the author

Nitesh Kumar

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.