flatpak ubuntu

Flatpak is a universal app packaging format for distributing sandboxed apps. Unlike distro-specific package distribution methods like .deb packages, flatpak apps can be installed and run on any Linux distro.

Canonical encourages the use of snaps as an alternative way to install packages on Ubuntu. Snap is similar to flatpak in various ways; snaps are universal, they’re sandboxed, and they make a wider range of programs conveniently available to users.

However, due to certain reasons (snap store being closed-source, the way Canonical is pushing snaps on Ubuntu, and so on), some users strongly dislike Snap. In this case, Flatpak can be an excellent alternative.

Installing Flatpak On Ubuntu

On any recent Ubuntu version, you can install Flatpak from the default repository.

sudo apt install flatpak

On Ubuntu 18.04 or any older version, you should add the Flatpak PPA first. Then, update your package index and install the Flatpak package.

sudo add-apt-repository ppa:flatpak/stable
sudo apt update && sudo apt install flatpak

Adding Flathub Repository

You’ve installed the Flatpak tool, but you don’t have access to any Flatpak repositories just yet. You can start by adding Flathub, which is the main Flatpak remote source (repo).

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

Now, restart your system to complete the installation.

If you want to add more remotes in the future, you can use .flatpakrepo files in the same manner. Simply replace flathub with the remote’s local name and adjust the URL.

Finding and Installing Flatpak Apps

Basic flatpak usage is pretty easy to understand. For starters, you can search for apps on the Flathub site, or find them from the terminal with the search command.

flatpak search <appname>

The standard syntax for installing Flatpak apps is

flatpak install <remotesource> <applicationID>

You can also install packages without specifying the remote source or using a vague package name.

flatpak install browser

For instance, with the above command, Flatpak will list some references from the Flathub repo that match the ‘browser’ keyword. You can select which app to install using the entry number.

Then, enter Y to proceed past the confirmation prompts.

Flatpak uses shared libraries, so installing the first app with Flatpak may take a while as it’s downloading these libraries for the first time. But the installation process should be swift for most apps afterward.

After installing the app, you can launch it from the Applications menu, or directly from the terminal by using the run command with the application ID.

flatpak run com.brave.Browser

Managing Flatpak Apps

You can list all installed Flatpak apps and runtimes with the list command.

flatpak list

If you want to update all Flatpak apps at once, you can use the update command.

flatpak update

If you’d prefer to only update a specific app, you can use the app ID like so

flatpak update com.brave.Browser

Finally, if you want to remove a Flatpak app, you can specify the app ID with the uninstall command.

flatpak uninstall com.brave.Browser

Some applications may leave behind some orphaned dependencies. You can remove those with the --unused option.

flatpak uninstall --unused
Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.