Installing Applications with Flatpak and Snap

27 December, 2023

I don’t know how many ways there are to install applications in Linux. Definitely more than a couple. You can use a software store or your distribution’s package manager. You can download and extract an archive or run an installer. And a few more ways that I’ve missed or just don’t know about.

To make installing applications easier, and avoid spiralling people into dependency hell, a pair of package management systems have gained a lot of traction in the Linux world over the last few years. Those systems? Flatpak and Snap.

Both are controversial. Both regularly raise the ire of people in certain corners of the Linux world. And I’m not going to go into any of that — if you’re interested, turn to your favourite search engine.

That said, Flatpak and Snap aren’t going away any time soon. So let’s take a look at how to use both Flatpak and Snap to install software from the Linux command line.

What are Flatpak and Snap?

Flatpak and Snap, as I mentioned a couple of paragraphs back, are package management systems. The idea behind them is to simplify the installation and management of software on Linux by including dependencies (like libraries or other software) with applications. The idea is to ensure compatibility of those applications across different Linux distributions.

Flatpak

Flatpak was created by the GNOME project. It’s a sandboxed environment, meaning the applications that you install using Flatpak are isolated from the rest of your system. This reduces the likelihood of conflicts and making updating those applications easy.

If you need to install Flatpak, you can find instructions at the Flatpak website.

Snap

Snap, on the other hand, was developed by Canonical (the company behind Ubuntu). Like Flatpak, Snap offers a sandboxed environment for applications (called snaps). The idea is to ensure the security and compatibility of applications across various Linux distributions.

Snap relies a program called the snap daemon to install and manage snaps. The snap daemon comes as part of many Linux distributions. If you need to install it, you can find instructions on the Snapcraft website.

Installing Applications with Flatpak

Let’s assume that Flatpak is installed on your computer — either as standard kit with your distribution or because you installed it yourself. So how do you install applications with it?

You can do that in two ways. One way is to search for an application on the Flathub website, copy the command to manuallly install it, and then paste that into a terminal window. Or, if you know the name of the application, you can open a terminal window and use this command to search for an application:

flatpak search [application-name]

For example:

flatpak search kooha

The case of the application’s name doesn’t matter — using Kooha and kooha return the same results.

Once you’ve found the application that you want to install, run this command:

flatpak install [application-name]

You’ll be asked to type Y or n. Type Y to install. Flatpak adds a shortcut to the application to your desktop menu.

Installing Applications with Snap

Let’s assume that the snap daemon is installed on your computer. So how do you install an application using snap?

As with Flatpak, you can do that in two ways. You can search for an application on the Snap Store, copy the command to manuallly install it, and then paste that into a terminal window. Or, you can find the name of the application by typing this command in a terminal to search for it:

snap find [application-name] | more

For example:

snap find notes | more

Adding | more to the command breaks a long list of results into individual pages that you can scroll through by pressing the spacebar on your keyboard.

When you’ve found the application that you want to install, run this command:

sudo snap install [application-name]

You’ll be asked to enter your password. Once you do that, the application installs and you can fire it up from your desktop application menu.

Scott Nesbitt