Snap, flatpak, app image, the battle for the sandboxed app format is raging on. With every Linux user and developer having their two cents worth as to their preference. Personally, I think they’re all good in different ways. But being as they are all Linux based if you use a distribution that doesn’t provide one out of the box (I.e Ubuntu shipping with snap package support.) You can easily install mechanisms to support others. Here we are going to look at installing flatpaks into Ubuntu and derivatives, although it should be noted it’s installed by default in Linux Mint as opposed to snappy.
What is Flatpak
Flatpak is one of the new generations of sandboxed package format application distribution systems. They are not tied to any single distribution meaning apps can be run on any Linux distro with the flatpak runtime installed. All required dependencies are included in the package and through the sandboxed app it connects to features and services of the host system.
The pros of using flatpaks include:
- Non Distribution specific installation, resulting in no dependency errors
- Updates directly from the developer rather than compiled and packaged through the distributions software channels.
- Sandboxed away from the main system.
- Greater control over permissions used by the software
- More developers are using newer packaging systems because of the ease of distribution across many different distributions.
The use of flatpaks does come with some costs though. Source code is not always available to view and modify through this method of distribution. And platform runtimes are required for example KDE and GTK apps download part of a baseline runtime to enable applications to connect. On certain apps, I’ve seen this mean extra installation of over 1GB over files. This is reasonable for using many flatpak apps but excessive for only using a few. Where the required files are probably already installed as part of the OS.
Install flatpak applications on Ubuntu
To set up simple add the PPA by opening a Terminal and adding:
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak
Next, Install the Flatpak Software plugin to add applications without the command line.
sudo apt install gnome-software-plugin-flatpak
And finally add the flat hub repository:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Reboot your system and your all set.
Installing Flatpak applications
Flatpaks from the dl.flathub repository are now installable through the Software app. Simply open the software centre and search for an application. If multiple options for the same application appear. It means it’s installable as a .deb file, snap or flatpak. Find the version you want to use. Installing a flatpak version is a simple as clicking on the install button.
Install from flathub.org
Head over to Flatpak store https://flathub.org/ and find an application you want to install for an example Blender. Clicking on the install button will download the repository for blender opening this file through the browser downloads or file manager will then open the software centre and give an option to install the application.
Managing via the terminal
The flathub also gives commands for installing via the terminal in the case of blender.
flatpak install flathub org.blender.Blender
and the following to run
flatpak run org.blender.Blender
Removing a Flatpak
Flatpaks can be removed via the software centre by simply clicking the remove button.
To remove via the terminal type:
flatpak uninstall org.blender.Blender
Some more useful flatpak terminal commands
Update all flatpak apps and runtimes
Show all installed flatpak
Repair flatpack installs
When removing flatpak associated runtime files don’t get removed with the apps as they can be shared with other apps. To remove unused runtimes simply enter:
flatpak uninstall --unused
As the runtimes are quite large snapshots of different parts of a system this can free up quite a bit of space and is advisable to do regularly.
What’s your prefered method of installing apps? Do you have some good Flatpak apps to recommend? Let us know in the comments.