Beyond APT: Software Management with Flatpak on Ubuntu

Beyond APT: Software Management with Flatpak on Ubuntu

Ubuntu has long relied on APT and DEB packages for software management, with Snap becoming increasingly prevalent in recent releases. However, a third contender has risen to prominence in the Linux world: Flatpak. Designed as a universal software packaging and distribution framework, Flatpak offers a fresh, sandboxed approach to application management that works seamlessly across distributions. In this article, we’ll dive into how to manage software with Flatpak on Ubuntu, providing everything you need to get started, optimize your workflow, and compare it with existing solutions.

What is Flatpak?

Flatpak is a modern application packaging system developed by the Free Desktop Project. Its goal is to enable the distribution of desktop applications in a sandboxed environment, ensuring greater security, consistency, and compatibility across Linux distributions.

Key Benefits of Flatpak
  • Cross-distribution compatibility: A single Flatpak package works on any Linux distribution with Flatpak support.

  • Sandboxing: Applications run in isolation, reducing the risk of affecting or being affected by other software or the host system.

  • Bundle dependencies: Flatpak packages include all necessary dependencies, reducing compatibility issues.

  • Version control: Developers can ship and maintain multiple versions easily.

Limitations
  • Storage overhead: Applications may use more disk space due to bundled runtimes.

  • Redundancy: Ubuntu users already have Snap, which can lead to confusion or duplication.

Installing Flatpak on Ubuntu

Although Flatpak isn't pre-installed on Ubuntu, setting it up is straightforward.

Step 1: Install Flatpak

Open a terminal and run:

sudo apt update sudo apt install flatpak

Step 2: Install GNOME Software Plugin (Optional)

To integrate Flatpak apps into the Ubuntu Software GUI:

sudo apt install gnome-software-plugin-flatpak

This step allows Flatpak apps to appear alongside APT and Snap apps in GNOME Software.

Step 3: Reboot or Log Out

Restart your session to apply system changes and enable Flatpak integration fully.

Adding the Flathub Repository

Most Flatpak applications are hosted on Flathub, the central repository for Flatpak packages.

To add Flathub:

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

To confirm the repository was added:

flatpak remotes

You should see flathub listed among the remotes.

Installing Applications with Flatpak

Flatpak provides both terminal and graphical interfaces for application management.

Using the Terminal

To search for an application:

flatpak search firefox

To install it:

flatpak install flathub org.mozilla.firefox

To run a Flatpak app:

flatpak run org.mozilla.firefox

Using GNOME Software

Once the plugin is installed and Flathub is added, you can search and install Flatpak apps using the GUI like any other software.

Managing Flatpak Applications

Listing Installed Applications

flatpak list

Updating Applications

To update all:

flatpak update

To update a specific app:

flatpak update org.gimp.GIMP

Uninstalling Applications

flatpak uninstall org.gimp.GIMP

To remove unused runtimes:

flatpak uninstall --unused

This helps recover space from outdated or unused shared dependencies.

Managing Permissions and Sandboxing

Flatpak’s sandboxing can sometimes restrict functionality. Thankfully, you can tweak permissions.

Using Flatpak Override

Grant access to specific directories:

flatpak override --user --filesystem=/path/to/dir org.example.App

Allow network access:

flatpak override --user --socket=network org.example.App

Using Flatseal

Flatseal is a GUI tool to manage Flatpak permissions easily.

Install it:

flatpak install flathub com.github.tchx84.Flatseal

Launch it to review and toggle settings like filesystem, device, and network access per app.

Integrating Flatpak with Ubuntu Desktop

Flatpak apps integrate well with Ubuntu once installed:

  • Application launchers: Appear in GNOME Dash/menu just like native apps.

  • File associations: Flatpak apps can open supported file types.

  • Desktop integration: Apps use system themes and settings where compatible.

To make Flatpak apps your default (e.g., default browser), you may need to manually set associations via GNOME Settings.

Flatpak for Developers (Optional)

Developers can create Flatpak packages using Flatpak manifests and the flatpak-builder tool.

Basic Steps
  1. Install flatpak-builder:

    sudo apt install flatpak-builder

  2. Create a manifest (JSON/YAML) defining dependencies and build steps.

  3. Build the app:

    flatpak-builder build-dir org.example.App.json

  4. Test it locally:

    flatpak-builder --run build-dir org.example.App.json /app/bin/app-executable

Developers can then submit their app to Flathub for wide distribution.

Flatpak vs Snap on Ubuntu

Feature Flatpak Snap
Sandbox Yes Yes
Main Repository Flathub Snap Store
Target Audience Desktop apps Desktop + IoT/Server
Storage Larger (due to runtimes) Compressed packages
Startup Time Slightly slower Often slower
Theming Support Better (via shared themes) Inconsistent
GUI Integration Excellent with GNOME Software Integrated in Ubuntu Software

 

In many cases, Flatpak offers more flexibility and consistency for desktop applications, while Snap leans toward system and server software. Many Ubuntu users choose to disable Snap in favor of Flatpak for desktop app management.

Conclusion

Flatpak is a powerful, secure, and distribution-independent approach to managing software on Ubuntu. While Ubuntu traditionally leans on APT and Snap, integrating Flatpak opens up a broader, more flexible application ecosystem—especially valuable for users seeking the latest app versions or better sandboxing.

Whether you're a casual user looking to try the newest GIMP or a developer packaging your own software for cross-distro deployment, Flatpak provides the tools to make Ubuntu more versatile and secure.

George Whittaker is the editor of Linux Journal, and also a regular contributor. George has been writing about technology for two decades, and has been a Linux user for over 15 years. In his free time he enjoys programming, reading, and gaming.

Load Disqus comments