How to Install and Use Flatpak on Ubuntu 24.04 LTS Linux

Let’s look at the steps to install Flatpak on Ubuntu 24.04 Linux using the command line.

Flatpak is an excellent alternative to Linux distros’ default package manager for installing various free and open-source applications. Moreover, it can be used across different Linux distributions, whether based on RHEL, Arch, Debian, or others. Like Ubuntu’s Snap, Flatpak also runs the applications inside a Sandbox environment, isolated from the rest of the system. This makes Flatpak more secure when testing and installing new applications, using some utility for deployment, app virtualization, and package management.

Step 1: Access Command Terminal

On Ubuntu 24.04, you can either press the Ctrl+Alt+T shortcut to run the Terminal application or go to the Application menu and search for it.

Step 2: Performing Update with APT

In the terminal, execute the system update command to refresh the package repository cache and install new updates or security patches if available.

sudo apt update && sudo apt upgrade

Step 3: Installing Flatpak on Ubuntu 24.04

The main package that will install and configure Flatpak on Ubuntu 24.04 is available directly through the default system repositories. Therefore, we need to execute the given command in our terminal.

sudo apt install flatpak

Step 4: Add the Flathub Repository

Although Flatpak will be installed by running the previous step’s command, it will not download the applications without having the proper package source. Therefore, we have now added the Fathub repository that Flatpak will use to fetch the packages required for the installation of the application requested by the users.

Add Flathub to your system using:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Step 5: Restart Your System

It is necessary to restart your Ubuntu system for the proper integration of Flatpak and working. So, in your terminal, execute:

sudo reboot

Step 6: Install Flatpak Applications

We are done with the installation process; now let’s see how we can use Flatpak to install some applications.

If you don’t know the exact name or ID of the package you want to install, for example, a VLC player, then we can search for it in the Flathub repository using this command.

flatpak search vlc
search for Flatpak application Flathub

After confirming the package or application, we can use the installation command.

Syntax:

flatpak install flathub application_ID

For example, to install the famous media player VLC, you would run:

flatpak install flathub org.videolan.VLC
Installing Flatpak application

Step 7: Run Flatpak Applications

We can run the applications installed via Flatpak using the Ubuntu Application GUI menu or the command line; let’s see both.

Go to the Ubuntu application menu and search for the app; for example, we have installed the VLC.

Run Flatpak installed application

Those who are interested in using the CLI can use the given syntax.

flatpak run application_ID

For example, to run VLC:

flatpak run org.videolan.VLC

Step 8: Update Flatpak Applications

Keeping your Flatpak applications up to date is crucial for security and performance. You can update all installed Flatpak applications with the following:

flatpak update

Step 9: Manage Installed Flatpak Applications

You can manage your installed applications by listing them using the following commands:

flatpak list

Uninstall an Application:

Removing the applications by Flatpak is also easy; first, list the installed ones using the previous step command, then use the application ID and the given command to remove them.

flatpak uninstall application_ID

For example:

flatpak uninstall org.videolan.VLC

You can also remove the unused apps with this command.

flatpak uninstall --unused

Conclusion

Flatpak is a good alternative to Ubuntu’s universal package manager, “SNAP,” and its default APT. Once you have installed it on Ubuntu 24.04, you can even have two instances of a single application. Hence, Flatpak ensures you can access a wide range of secure and easy-to-maintain software.

Other Articles:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.