2024-12-28
Before you can use Flatpak, you’ll need to install it. The installation process varies slightly depending on your distribution, but the general steps are similar. Here are instructions for some popular distributions:
Fedora/Red Hat/CentOS:
sudo dnf install flatpak
Debian/Ubuntu:
sudo apt install flatpak
Arch Linux:
sudo pacman -S flatpak
After installation, you might need to add the Flathub repository, the largest collection of Flatpak applications. This is done using the following command:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Once Flatpak is installed and Flathub is added, you can search for applications. Let’s say you want to find a text editor:
flatpak search --remote flathub org.gnome.gedit
This will search the Flathub repository for applications containing “gedit” in their name or description. You can replace org.gnome.gedit
with any other application name or part of it.
Installing an application is straightforward. Using the example of Gedit:
flatpak install flathub org.gnome.gedit
This command installs Gedit from the Flathub repository. You can replace org.gnome.gedit
with the application ID found during your search. If you’re installing multiple applications, just list their IDs separated by spaces.
Keeping your applications updated is important for security and stability. Flatpak makes this easy:
flatpak update
This command checks for updates for all your installed Flatpak applications and installs them. You can also update individual applications:
flatpak update org.gnome.gedit
To see a list of all your installed Flatpak applications:
flatpak list
This provides a concise overview of the installed applications, including their application ID and version.
If you no longer need an application, you can uninstall it using:
flatpak uninstall org.gnome.gedit
Replace org.gnome.gedit
with the application ID you want to remove.
Flatpak uses runtimes, which are sets of libraries and dependencies required by applications. You can list available runtimes with:
flatpak remote-ls flathub --app
And update runtimes individually or all of them:
flatpak update --runtime
flatpak update --system
These examples cover the essential commands for managing Flatpak applications. With its sandboxed environment and simple commands, Flatpak offers a convenient and reliable way to manage software on your Linux system. Remember to replace example application IDs with those you find when searching for specific software.