Skip to main content

Command Palette

Search for a command to run...

How to Install Flatpak on Linux

Published
6 min readView as Markdown

Installing Flatpak on Linux is a great way to access a wide range of applications in a secure and consistent environment. If you want to run the latest software without worrying about your Linux distribution’s package versions, Flatpak offers a universal solution. In this guide, I’ll walk you through the process of installing Flatpak on your Linux system, no matter which distribution you use.

You’ll also learn how to add the Flathub repository, which hosts thousands of apps, and how to manage Flatpak apps easily. By the end, you’ll be ready to enjoy a smoother, safer way to install and update your favorite programs on Linux.

What is Flatpak and Why Use It?

Flatpak is a software utility for Linux that allows you to install and run applications in a sandboxed environment. This means apps are isolated from the rest of your system, improving security and stability. Flatpak packages include all the dependencies an app needs, so you don’t have to worry about conflicting libraries or outdated software.

Here are some reasons why Flatpak is popular:

  • Cross-distribution compatibility: Works on almost any Linux distro.
  • Sandboxing: Keeps apps isolated to protect your system.
  • Easy updates: Apps update independently from your system packages.
  • Access to latest apps: Get the newest versions even if your distro’s repos are outdated.

Flatpak is especially useful if you want to try new software without risking your system’s stability.

Checking if Flatpak is Already Installed

Before installing Flatpak, you might want to check if it’s already on your system. Many modern Linux distributions include Flatpak by default or offer it in their official repositories.

To check, open your terminal and type:

flatpak --version

If you see a version number, Flatpak is installed. If you get a “command not found” message, you’ll need to install it.

Installing Flatpak depends on your Linux distribution. Below are the commands for some of the most common distros.

Ubuntu and Debian-based Systems

Ubuntu and Debian users can install Flatpak using the APT package manager:

sudo apt update
sudo apt install flatpak

After installation, it’s a good idea to restart your system or log out and back in to ensure Flatpak integrates properly.

Fedora

Fedora comes with Flatpak support out of the box, but if it’s missing, install it with:

sudo dnf install flatpak

Fedora users usually don’t need to add extra repositories since Flatpak is well supported.

Arch Linux and Manjaro

Arch Linux and its derivatives like Manjaro use the Pacman package manager:

sudo pacman -S flatpak

Arch users benefit from the latest Flatpak versions due to Arch’s rolling release model.

OpenSUSE

For OpenSUSE Leap or Tumbleweed, use Zypper:

sudo zypper install flatpak

After installation, you might want to enable the Flatpak service.

Other Distributions

If your distro isn’t listed, check its package manager or official documentation. Flatpak is widely supported, so you’ll likely find an easy way to install it.

Adding the Flathub Repository

Flathub is the main source for Flatpak apps. It hosts thousands of applications, from browsers to games, all packaged for Flatpak.

To add Flathub, run this command in your terminal:

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

This command adds Flathub as a source for Flatpak apps. You only need to do this once.

Installing Flatpak Applications

Once Flatpak and Flathub are set up, installing apps is straightforward. You can search for apps on the Flathub website or use the terminal.

To install an app, use:

flatpak install flathub <app-id>

For example, to install the popular code editor Visual Studio Code:

flatpak install flathub com.visualstudio.code

Flatpak will download the app and all necessary dependencies.

Running Flatpak Applications

After installation, run your Flatpak app with:

flatpak run <app-id>

Using the previous example:

flatpak run com.visualstudio.code

Many desktop environments also add Flatpak apps to your application menu automatically.

Managing Flatpak Applications

Flatpak includes commands to keep your apps updated and remove them when needed.

  • Update all Flatpak apps:
flatpak update
  • List installed Flatpak apps:
flatpak list
  • Remove a Flatpak app:
flatpak uninstall <app-id>
  • View info about an app:
flatpak info <app-id>

These commands help you maintain your Flatpak apps easily.

Troubleshooting Common Flatpak Issues

Sometimes you might face issues with Flatpak. Here are some common problems and fixes:

  • Flatpak command not found: Make sure Flatpak is installed and your PATH is set correctly.
  • Apps not showing in menu: Log out and back in, or restart your system.
  • Permission issues: Use Flatseal, a GUI app to manage Flatpak permissions.
  • Slow app startup: The first launch may be slow due to sandbox setup; subsequent launches are faster.

If problems persist, check your distro’s forums or the Flatpak GitHub page for help.

Benefits of Using Flatpak on Linux

Using Flatpak brings several advantages:

  • Security: Sandboxed apps reduce risk from malicious software.
  • Consistency: Apps behave the same across different Linux distributions.
  • Latest software: Get new features and fixes faster than traditional repos.
  • Easy rollback: You can revert to previous app versions if needed.

Flatpak is a modern way to manage Linux software, especially if you want flexibility and security.

Alternatives to Flatpak

While Flatpak is popular, there are other packaging systems:

  • Snap: Developed by Canonical, Snap also offers sandboxed apps.
  • AppImage: Portable apps that don’t require installation.
  • Traditional package managers: Like APT, DNF, or Pacman.

Each has pros and cons, but Flatpak stands out for its wide support and strong sandboxing.

Conclusion

Installing Flatpak on Linux is a simple process that opens up a world of secure and up-to-date applications. Whether you use Ubuntu, Fedora, Arch, or another distro, you can easily set up Flatpak and add the Flathub repository to access thousands of apps. Managing Flatpak apps is straightforward with commands to install, update, and remove software.

By using Flatpak, you gain better security, consistency, and access to the latest software versions. It’s a smart choice if you want a flexible and reliable way to run apps on Linux without worrying about dependency conflicts or outdated packages.

FAQs

How do I check if Flatpak is installed on my Linux system?

Open your terminal and type flatpak --version. If you see a version number, Flatpak is installed. Otherwise, you’ll need to install it using your distro’s package manager.

Can I use Flatpak alongside my system’s package manager?

Yes, Flatpak works independently from your system’s package manager. You can use both without conflicts to install and manage different apps.

Is Flatpak safe to use?

Flatpak apps run in a sandbox, isolating them from your system. This improves security by limiting app access to your files and system resources.

How do I update all my Flatpak apps at once?

Run the command flatpak update in your terminal. This will check for and install updates for all installed Flatpak applications.

Can I uninstall Flatpak apps easily?

Yes, use flatpak uninstall <app-id> to remove any Flatpak app. You can find the app ID by running flatpak list.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts