One of the best parts of using a GNU/Linux system is the inclusion of a package manager. The package manager makes it easy to browse, install, and remove a variety of software on your system.
However, not all GNU/Linux distributions use the same package manager, and each distribution may use different versions of a software application (or different libraries that the application relies on). If you are a person that needs to use multiple machines with different distributions, this can cause compatibility problems.
A variety of solutions has been created to address cross-distribution compatibility issues (e.g., AppImage and Snappy). One nice implementation that is gaining popularity is Flatpak.
Note: If you are not familiar with the GNU/Linux command line interface, or you intend to use a script obtained from this site, review the Conventions page before proceeding.
Installation
Some GNU/Linux distributions come with flatpak installed, e.g., Fedora. For others, you will need to install flatpak from the distribution's repository.
For Debian, you can do this with the following command:
# apt install flatpak
Basic Commands
Here are several basic flatpak commands to get you started.
Note: These commands use the --user option. This limits the scope of the commands to your user account. To have the commands affect all user accounts (i.e., act system-wide), you can leave off the --user option.
flatpak install --user ex_app_identifier...- Install a Flatpak app.
- Here,
ex_app_identifiercan be a local file (e.g.,org.videolan.VLC.flatpakref) or a remote file (e.g.,https://flathub.org/repo/appstream/org.videolan.VLC.flatpakref). - Flatpak apps installed in this manner can be accessed via
${HOME}/.local/share/flatpak/exports/bin/and their data is located in${HOME}/.var/app/. flatpak run --user ex_app_identifier- Run a Flatpak app (e.g.,
flatpak run --user org.videolan.VLC). flatpak list --user- List installed Flatpak apps.
flatpak info ex_app_identifier- Show information about an installed application or runtime. Add the
-Moption to show an application's permissions. flatpak uninstall --user ex_app_identifier...- Remove a Flatpak app.
flatpak uninstall --user --delete-data ex_app_identifier...- Remove a Flatpak app, along with its data in
${HOME}/.var/app/.
Remotes
Flatpak supports the concept of a remote source, i.e., a repository. At present, the most popular Flatpak remote is Flathub.
You can add Flathub as a remote source for flatpak with this command:
flatpak remote-add --user --if-not-exists flathub 'https://flathub.org/repo/flathub.flatpakrepo'
Once you have configured a Flatpak remote, like Flathub, you can benefit from the following commands:
flatpak remotes --user- List configured
flatpakremotes. flatpak remote-delete --user ex_remote_name- Delete a
flatpakremote (e.g.,flatpak remote-delete --user flathub). flatpak remote-ls --user ex_remote_name- Show remote's available runtimes and apps (e.g.,
flatpak remote-ls --user flathub). flatpak remote-ls --user ex_remote_name | grep ex_string- Search a
flatpakremote for a string (e.g.,flatpak remote-ls --user flathub | grep 'VLC'). flatpak install --user ex_remote_name ex_app_identifier...- Install an app from a
flatpakremote (e.g.,flatpak install --user flathub org.videolan.VLC). flatpak update --user- Update installed Flatpak apps.
Documentation
For more on Flatpak, peruse the flatpak man page in the Linux User's Manual (man 1 flatpak) and check out the online documentation.