Installing Flatpak Packages
Once you install and configure Flatpak on Linux, it is quite easy to install packages using Flatpak. The easiest way is to grab the installation command from the Flatpak package page and execute it on the terminal:
Looking for detailed steps? Here you go.
Step 1: Search for the package
You can either use the Flatpak webpage or terminal to search for packages. To search packages through the terminal, use the flatpak
command with the search
flag as shown:
flatpak search <package_name>
For example, if I want to search the spotify
package, then I'll use the following command:
flatpak search spotify
From the entire output, the only thing which is important for installation is the Application ID as you will be using it to install the package in the next step.
So copy the package ID of the target package.
Step 2: Install Flatpak package
Once you know the package name, enter the package name in the given command:
flatpak install flathub <Application ID>
As I wanted to install Spotify, my Application ID is com.spotify.Client
and I will use the following command to install it:
flatpak install flathub com.spotify.Client
Installing a package through flatpakref
When searching for a package on Flathub, if you press the Install
button, it will download a .flatpakref
file for an application. Think of it as a torrent file which includes information of all the necessary information.
To install a package through a .flatpakref
file, you will have to specify the path to the a .flatpakref
file with the Flatpak
command as shown here:
flatpak install <path-to-flatpakref file>
In my case, a .flatpakref
file for Spotify is located inside my Downloads
directory, so I'll use the following:
flatpak install ~/Downloads/com.spotify.Client.flatpakref
Yep, it is that easy!
Step 3: Run a Flatpak package
The easiest way to run the installed Flatpak package is to run it from the system app menu. But if you prefer a terminal for everything, then first, you need to know the application ID of the package.
For that purpose, you need to list the installed packages to know the application name. To list installed packages, use the following:
flatpak list
Once you know the application ID of the target package, enter the application ID in the following command:
flatpak run <Application-ID>
For example, if I wanted to run Spotify, then I would use the following:
flatpak run com.spotify.Client
That's it!
Wrapping Up...
In this quick tutorial, I went through how you can install packages through flatpak including multiple methods and how to run them.
I hope you will find this helpful and if you have any queries, leave us a comment.