Flatpak on Ubuntu: install, add Flathub, manage apps
How to get Flatpak on Ubuntu and get access to more apps than just Snaps and .debs
Ubuntu includes Snap but not Flatpak. This guide enables Flatpak on Ubuntu, adds the Flathub repository and covers the commands for finding, installing, updating and removing applications.
Written for Ubuntu in January 2023. The steps have not been retested on later releases.
What Flatpak is
Flatpak is a free and open-source system for distributing applications and running them in a sandbox. An application is a bundle containing its code, libraries and data, so the same bundle runs on different Linux distributions. Bundles are published in repositories, which you add to your system and install from. The sandbox isolates each application from the rest of the system and from other applications.
Installing Flatpak
Install the package:
sudo apt install flatpak
Then add Flathub, the main Flatpak repository:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Optionally, install the Flatpak plugin for GNOME Software, which lets you manage Flatpak applications from the graphical software centre:
sudo apt install gnome-software-plugin-flatpak
Adding Flathub for your own user
Flatpak can also work at user level. To add Flathub for your user only:
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
To list the applications you have installed:
flatpak --user list --app
Finding applications
Once Flathub is added, you can search in GNOME Software or from the terminal:
flatpak search <application name>
Installing applications
In GNOME Software, select the Flatpak version of the application and click Install. From the terminal:
flatpak --user install <application name>
Adding other repositories
Flathub is the main repository, but it is not the only one. To add another, run one of these:
flatpak --user remote-add <repository name> <repository URL>
or
sudo flatpak remote-add <repository name> <repository URL>
Managing installed applications
You can manage installed applications in GNOME Software or from the terminal. To list them:
flatpak list --app
To see details of one application:
flatpak info <application name>
Command reference
flatpak list --app: List all installed applications.flatpak info <application name>: Get information about an installed application.flatpak install <application name>: Install an application.flatpak uninstall <application name>: Uninstall an application.flatpak update: Update all installed applications.flatpak --user remote-add <repository name> <repository URL>: Add a remote repository.
Troubleshooting
If an application misbehaves, first update it:
flatpak --user update <application name>
If that does not help, reinstall it:
flatpak --user uninstall <application name>
flatpak --user install <application name>
If that fails too, remove it and reinstall it from a different repository:
flatpak --user uninstall <application name>
flatpak --user remote-add <repository name> <repository URL>
flatpak --user install <application name>
User and system installs
The commands above often use the --user switch with flatpak. This makes flatpak work at user level: the apps you install are available only to your own user. For system-wide availability, use --system and run most of the flatpak commands with sudo.