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 flatpakDebian/Ubuntu:
sudo apt install flatpakArch Linux:
sudo pacman -S flatpakAfter 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.flatpakrepoOnce 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.geditThis 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.geditThis 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 updateThis command checks for updates for all your installed Flatpak applications and installs them. You can also update individual applications:
flatpak update org.gnome.geditTo see a list of all your installed Flatpak applications:
flatpak listThis 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.geditReplace 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 --appAnd update runtimes individually or all of them:
flatpak update --runtime
flatpak update --systemThese 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.