Skip to content
Home » Linux » How to Install Flatpak on Ubuntu using Command Line

How to Install Flatpak on Ubuntu using Command Line

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 in Ubuntu is easy and there is more than one way to do it. But, there are so many different Linux distributions each with its 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 or install Flatpak on 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 the 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.

Install Flatpak on 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 command line to install flatpak

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 in 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. To do so, install the Flatpak plugin using this command:

sudo apt install gnome-software-plugin-flatpak

install gnome software plugin

Once this is installed, restart the Software Center. From now on, you can double-click a .flatpakref package file and it will open up in the Software Center as 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 the 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.

Read Next: Best Photo Management Software for Linux

Vivek Tiwari

Vivek Tiwari

Blogger, Android nerd, Cosmic geek (yes, geek and nerd are not the same, see I know), certified Superman encyclopedia (bragging), local Tech guru. I have been contributing for Technastic and its sister sites for a decade.View Author posts