Skip to content

popey/add-flatpak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add Flatpak

Add Flatpak is a small helper app for Ubuntu desktop systems.

Its job is simple: help a user install Flatpak support, optionally add Flathub, optionally install graphical software-store integration, validate the result, and then remove itself when it is no longer needed.

Who This Is For

This app is intended for Ubuntu desktop users who do not want to copy and paste terminal commands from a website.

It is especially aimed at fresh Ubuntu installs where Flatpak is not already installed.

What It Does

On a supported Ubuntu system, Add Flatpak can:

  • install flatpak;
  • add the Flathub remote;
  • install GNOME Software if needed;
  • install gnome-software-plugin-flatpak on GNOME or Ubuntu Desktop;
  • install plasma-discover-backend-flatpak on KDE Plasma;
  • check that the setup worked;
  • offer to remove the setup helper when finished.

Flathub and graphical app-store integration are optional in the app, but enabled by default.

What It Will Not Do

Add Flatpak is deliberately cautious.

  • It will not run host package-management commands while still inside snap confinement.
  • It will not try to use apt on Fedora, Red Hat, immutable systems, or other non-Ubuntu systems.
  • It will not build privileged shell commands from user input.
  • It will not remove gnome-software during normal cleanup, because that may have existed before Add Flatpak was used.

Supported Systems

This test build currently allows setup on:

  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS
  • Ubuntu 26.04 LTS

Other Ubuntu releases and non-Ubuntu distributions are blocked for now.

Why There Are Two Steps

Add Flatpak is packaged as a strictly confined snap.

That is good for safety, but it means the first app launch cannot directly change the host system with apt install or system Flatpak remote commands.

The app therefore uses two steps:

  1. Add Flatpak Initial Setup This is the snap app. It prepares a Desktop launcher.

  2. Enable Flatpak This is the Desktop launcher created by the first step. It runs the same app from the snap mount without the snap runtime environment, so it can clearly ask for permission and perform host setup.

This is why the user sees an initial setup window, then a Desktop icon named Enable Flatpak.

Password Prompts

The setup path is designed to ask for the administrator password once.

After the user reviews the plan and clicks Run Setup, the app runs one privileged helper command with pkexec. That helper then performs the selected setup actions.

Cleanup may ask for the password once more, because removing the snap itself is a separate privileged action.

Normal User Flow

  1. Install the add-flatpak snap.
  2. Launch Add Flatpak Initial Setup.
  3. Click Prepare Helper.
  4. The app creates an Enable Flatpak launcher on the Desktop and exits.
  5. Launch Enable Flatpak from the Desktop.
  6. Review the planned changes.
  7. Choose whether to add Flathub and app-store integration.
  8. Tick I have reviewed the planned changes.
  9. Click Run Setup.
  10. Enter the administrator password when prompted.
  11. Review the validation results.
  12. Optionally click Remove Setup Helper to remove the Desktop launcher and purge the snap.

If the Desktop says the launcher is not trusted, right-click Enable Flatpak and choose Allow Launching.

Current Implementation Choices

  • Language: Go
  • UI toolkit: Fyne
  • Package format: snap
  • Snap confinement: strict
  • Snap base: core24
  • Privilege prompt: pkexec
  • License: MIT

The older shell implementation was only a prototype. The Go implementation is now the maintained version.

The app shells out to stable host commands such as apt, flatpak, dpkg-query, and snap. It does not use apt or snap APIs directly. This keeps the implementation understandable and avoids depending on unstable or distro-specific Go bindings.

Building

Build the snap from this directory:

snapcraft

Install a local build:

sudo snap install --dangerous ./add-flatpak_0.1.0_amd64.snap

Run it:

snap run add-flatpak

When testing over SSH into an X11 desktop session, you may need:

DISPLAY=:0 snap run add-flatpak

Validation

Useful development checks:

gofmt -w .
go test ./...
snapcraft --verbose
review-tools.snap-review add-flatpak_0.1.0_amd64.snap

Resetting A Test Machine

For repeated local testing, there is a helper script:

scripts/reset-test-host.sh --yes

This removes Flatpak, Flathub remotes, and Flatpak app-store integration packages.

To also remove GNOME Software:

scripts/reset-test-host.sh --yes --include-gnome-software

Only use this script on a disposable test machine or a system you are happy to modify.

Screenshots

First-pass screenshots live in screenshots/.

These are development screenshots for reviewing the flow. Store-ready screenshots still need to be captured from clean test systems.

Known Follow-Up Work

  • Test on clean installs of Ubuntu 22.04, 24.04, and 26.04.
  • Test Kubuntu, Xubuntu, non-Ubuntu Debian, Fedora, and immutable systems.
  • Decide whether older Ubuntu releases need a non-pkexec fallback.
  • Prepare Snap Store metadata and store-quality screenshots.
  • Investigate the SSH-launched GUI warning about libpxbackend-1.0.so.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors