Geek Stuff Linux Tutorials

How to Enable Flatpak Support in Ubuntu

vivektwr23@gmail.com'
Written by Vivek

Linux is a free and open source operating system just like Android. Linux is also fragmented, to an extent, quite like Android. For instance, installing applications is easy and there are more than one ways to do it. But, there are so many different Linux distributions each with its own packaging format that it gets tedious and confusing. Apps not available in the official stores can be installed via packages, but there are so many different kinds of them for different Linux distros. Debian uses DEB packages, for example, whereas SUSE uses RPM packages. The need for a uniform packaging format was felt, and that has resulted in Flatpak, and some others. Today we’ll see how you can enable Flatpak support in Ubuntu.

Flatpak is a universal packaging format from Fedora. It works across all Linux distributions and there are already many apps available as Flatpaks. Canonical, the creators of Ubuntu also have created something similar that they call Snaps. Similarly, there is an independent packaging format known as Appimage. These are all different packaging systems and often you’ll find programs that are available as only one of them. This kind of beats the purpose of a single unified packaging system. However, all of these do work across any Linux distributions so they’re still better than platform-specific packaging systems.

The primary goal of Flatpak is ease of distribution for apps and more control for application developers. It’s a containerized approach to developing Linux apps. “We want the Linux desktop to be a single platform that developers can easily target and we want them to be able to build and release their apps the way they want, according to their schedule and not someone else’s. And if we solve that problem, we think it will mean a lot more desktop apps being available,” said Allan Day and Alexander Larsson who are involved with Flatpak.

You may also like: How to Install Unity Desktop on Ubuntu 18.04

Enable Flatpak support in Ubuntu

Ubuntu 18.04 already comes with Flatpak support built-in. You can verify this by trying to install Flatpak again using the following command.

sudo apt install flatpak How To Enable Flatpak Support in Ubuntu

Previous versions of Ubuntu do not support Flatpaks out of the box, however. These and any other Debian based distros can use the official PPA to install Flatpak. Open up a terminal and enter the following commands one by one to add the PPA, update the system and install Flatpak.

sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak

When you have Flatpak installed, it may be a good idea to also add the Flatpak repository. This ensures that you can easily download and install apps available as flatpak. You can add this repository by using this command:

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

Enable Flatpak support in the GNOME Software Center

Generally, Flatpak apps can be installed via the Terminal only. For instance, if you’ve downloaded a .deb package file on your Ubuntu system, you can either use the Terminal or simply double-click on it and let the Software Center or another package installer take care of the installation for you. If you download a .flatpakref you can only install it via the Terminal, by default. You can do this by using the following command:

flatpak install <package-name>

There are even ways to search for flatpaks and install them directly from the repositories using the Terminal and commands. Not everyone is very comfortable with the command line though. If you’re using GNOME, which is the default desktop environment on Ubuntu 17.10+ and Ubuntu 18.04+, you can enable Flatpak support in the GNOME Software Center. For this, first install the flatpak plugin using this command:

sudo apt install gnome-software-plugin-flatpak

How To Enable Flatpak Support in Ubuntu

Once this is installed, restart Software Center. From now on, you can double-click a .flatpakref package file and it will open up in the Software Center like any .deb file does. Alternatively, you can right-click on the file and select Open with Software Install (default). When the package opens up in Software Center, you can click on the Install button to directly install it. The best place to look for Flatpak packages is the official Flatpak application store known as Flathub.

Recommended for you: How to Enable Click to Minimize on Ubuntu 18.04