Skip to content

Migrate to Flatpak pre-install #783

Description

@danirabbit

What Happened?

Currently we're using deb packages to pull in flatpak packages so that we have a way to manage removing or changing them

Steps to Reproduce

Check packages for:

  • calculator
  • camera
  • capnet assist
  • document viewer
  • fonts
  • file-roller
  • maps
  • music
  • screenshot
  • videos
  • web

Expected Behavior

We should migrate these to flatpak pre-install: https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-preinstall

Activity

  1. added theissue type on Oct 25, 2025
  2. moved this to Confirmed in OS 9on Oct 25, 2025
  3. danirabbit commented on Oct 25, 2025

    @danirabbit
    MemberAuthor

    I wonder if this should be shipped in default-settings actually

  4. ryonakano commented on Jul 3, 2026

    @ryonakano
    Member

    flatpak preinstall was introduced in flatpak 1.17.01, whereas Resolute ships flatpak 1.16.62. So we can work on this only for Ubuntu 28.04 LTS or later unless we import newer version of flatpak for OS 9 on our PPA.

    Footnotes

    1. https://github.com/flatpak/flatpak/commit/d10e11482d42996c47bc0d4f97b513fc197a7e2b ↩

    2. https://packages.ubuntu.com/en/resolute/flatpak ↩

  5. ryonakano commented on Jul 3, 2026

    @ryonakano
    Member

    I wonder if this should be shipped in default-settings actually

    I agree with this. Having files in the os repository makes it impossible to update the .preinstall files through system updates.

    Can't be merged for now as I mentioned above but I opened a PR in default-settings: elementary/default-settings#364

  6. moved this from Confirmed to In progress in OS 9on Jul 4, 2026
  7. added
    Status: BlockedSomething else needs to be done before this can be fixed
    Priority: WishlistNot a priority, but something that might be nice
    on Jul 4, 2026
  8. removed this from OS 9on Jul 4, 2026
  9. ryonakano commented on Jul 23, 2026

    @ryonakano
    Member

    I confirmed flatpak 1.18.0 packaged for Stonking can be built successfully without modification on Ubuntu 26.04 LTS, so we can pull it if we want to resolve this task in OS 9.

    user@ubuntu-26:~/work$ flatpak --version
    Flatpak 1.18.0
    user@ubuntu-26:~/work$ flatpak preinstall --help
    Usage:
      flatpak preinstall [OPTION…] - Install flatpaks that are part of the operating system
    
    Help Options:
      -h, --help               Show help options
    
    Application Options:
      -u, --user               Work on the user installation
      --system                 Work on the system-wide installation (default)
      --installation=NAME      Work on a non-default system-wide installation
      --no-pull                Don't pull, only install from local cache
      --no-deploy              Don't deploy, only download to local cache
      --no-related             Don't install related refs
      --no-deps                Don't verify/install runtime dependencies
      --no-static-deltas       Don't use static deltas
      --include-sdk            Additionally install the SDK used to build the given refs
      --include-debug          Additionally install the debug info for the given refs and their dependencies
      -y, --assumeyes          Automatically answer yes for all questions
      --reinstall              Uninstall first if already installed
      --noninteractive         Produce minimal output and don't ask questions
      --sideload-repo=PATH     Use this local repo for sideloads
      -v, --verbose            Show debug information, -vv for more detail
      --ostree-verbose         Show OSTree debug information
    
    user@ubuntu-26:~/work$ cat /etc/os-release 
    PRETTY_NAME="Ubuntu 26.04 LTS"
    NAME="Ubuntu"
    VERSION_ID="26.04"
    VERSION="26.04 LTS (Resolute Raccoon)"
    VERSION_CODENAME=resolute
    ID=ubuntu
    ID_LIKE=debian
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    UBUNTU_CODENAME=resolute
    LOGO=ubuntu-logo
    user@ubuntu-26:~/work$ 
    

    What I did:

    sudo apt install -yU sbuild mmdebstrap git-buildpackage ubuntu-dev-tools
    mkdir work
    cd work/
    pull-lp-source flatpak stonking
    sbuild -d resolute flatpak_1.18.0-1.dsc
    sudo apt install ./*.deb
    
  10. pinned and unpinned a comment on Jul 23, 2026
  11. moved this to Confirmed in OS 9on Jul 25, 2026
  12. 7 remaining items

  13. linked a pull request that will close this issueMigrate to debhelper 13 #366on Aug 14, 2026
  14. ryonakano commented on Aug 14, 2026

    @ryonakano
    Member

    Another issue found: elementary-default-settings package overwrites what flatpak package provides under /var/lib/flatpak/repo/, causing flatpak update, flatpak preinstall, etc. isn't working.

    user@elementary-9-daily:~$ sudo apt install --reinstall elementary-default-settings 
    Installing:                     
      elementary-default-settings
    
    Installing dependencies:
      flatpak
    
    Suggested packages:
      malcontent-gui
    
    Summary:
      Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 0
      Download size: 1,620 kB
      Space needed: 7,078 kB / 52.8 GB available
    
    Continue? [Y/n] 
    Get:1 https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu resolute/main amd64 flatpak amd64 1.18.1-1+elementary3~ubuntu9.1 [1,606 kB]
    Get:2 https://ppa.launchpadcontent.net/elementary-os/daily/ubuntu resolute/main amd64 elementary-default-settings all 8.1.1+r457+pkg326~daily~ubuntu9.1 [14.0 kB]
    Fetched 1,620 kB in 3s (480 kB/s)
    Selecting previously unselected package flatpak.
    (Reading database… 150546 files and directories currently installed.)
    Preparing to unpack …/flatpak_1.18.1-1+elementary3~ubuntu9.1_amd64.deb…
    Unpacking flatpak (1.18.1-1+elementary3~ubuntu9.1)…
    Selecting previously unselected package elementary-default-settings.
    Preparing to unpack …/elementary-default-settings_8.1.1+r457+pkg326~daily~ubuntu9.1_all.deb…
    Unpacking elementary-default-settings (8.1.1+r457+pkg326~daily~ubuntu9.1)…
    Setting up flatpak (1.18.1-1+elementary3~ubuntu9.1)…
    error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(objects): No such file or directory
    Setting up elementary-default-settings (8.1.1+r457+pkg326~daily~ubuntu9.1)…
    Created symlink '/etc/systemd/system/multi-user.target.wants/flatpak-preinstalld.service' → '/usr/lib/systemd/system/flatpak-
    preinstalld.service'.
    Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 148.
    Processing triggers for dbus (1.16.2-2ubuntu4)…
    Processing triggers for desktop-file-utils (0.28-1build1)…
    Processing triggers for doc-base (0.11.2build1)…
    Processing 1 added doc-base file...
    Processing triggers for man-db (2.13.1-1build1)…
    Processing triggers for libglib2.0-0t64:amd64 (2.88.0-1)…
    user@elementary-9-daily:~$ flatpak update 
    error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(objects): No such file or directory
    user@elementary-9-daily:~$ flatpak preinstall -y
    error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(objects): No such file or directory
    user@elementary-9-daily:~$ ls /var/lib/flatpak/repo/
    appcenter.trustedkeys.gpg  config  flathub.trustedkeys.gpg
    user@elementary-9-daily:~$
    

    c.f. when installing only flatpak, /var/lib/flatpak/repo/ contains necessary subdirectories like objects and tmp:

    user@elementary-9-daily:~$ sudo apt install --reinstall flatpak
    Installing:                     
      flatpak
    
    Suggested packages:
      malcontent-gui
    
    Summary:
      Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0
      Download size: 1,606 kB
      Space needed: 6,979 kB / 52.8 GB available
    
    Get:1 https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu resolute/main amd64 flatpak amd64 1.18.1-1+elementary3~ubuntu9.1 [1,606 kB]
    Fetched 1,606 kB in 3s (516 kB/s)  
    Selecting previously unselected package flatpak.
    (Reading database… 150546 files and directories currently installed.)
    Preparing to unpack …/flatpak_1.18.1-1+elementary3~ubuntu9.1_amd64.deb…
    Unpacking flatpak (1.18.1-1+elementary3~ubuntu9.1)…
    Setting up flatpak (1.18.1-1+elementary3~ubuntu9.1)…
    Processing triggers for man-db (2.13.1-1build1)…
    Processing triggers for dbus (1.16.2-2ubuntu4)…
    Processing triggers for doc-base (0.11.2build1)…
    Processing 1 added doc-base file...
    user@elementary-9-daily:~$ ls /var/lib/flatpak/repo/
    config  extensions  objects  refs  state  tmp
    user@elementary-9-daily:~$ 
    
  15. ryonakano commented on Aug 14, 2026

    @ryonakano
    Member

    Probably we need to provide our configuration files as fragment files.

  16. ryonakano commented on Aug 15, 2026

    @ryonakano
    Member

    However, I feel like that would be automatically done when the default-settings packages is installed into the image.

    Tested with elementaryos-9.0-daily-amd64.20260815.iso. Flatpak apps are preinstalled in the installed session. However, they're not in the live session and they're installed when booted instead:

             Starting lightdm.service - Light Display Manager...
             Starting plymouth-quit-wait.servic…d until boot process finishes up...
    NetworkManager-wait-online.service
    [  OK  ] Finished NetworkManager-wait-onlin…vice - Network Manager Wait Online.
    [  OK  ] Reached target network-online.target - Network is Online.
             Starting flatpak-preinstalld.service - Preinstall Flatpaks...
    [  OK  ] Finished malcontent-webd-update.se…ntal Controls Web Filtering Daemon.
    malcontent-webd-update.service
    ModemManager.service
    [  OK  ] Started ModemManager.service - Modem Manager.
    cups.service
    [  OK  ] Started cups.service - CUPS Scheduler.
    
    elementary OS 9 Early Access elementary ttyS0
    
    elementary login: elementary
    Welcome to elementary OS 9 Early Access (GNU/Linux 7.0.0-29-generic x86_64)
    Built on Ubuntu 26.04 LTS
    Website: https://elementary.io
    
    The programs included with the elementary OS system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    elementary OS comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    
    elementary@elementary:~$ systemctl status flatpak-preinstalld.service
    ● flatpak-preinstalld.service - Preinstall Flatpaks
         Loaded: loaded (/usr/lib/systemd/system/flatpak-preinstalld.service; enabled; preset: enabled)
         Active: activating (start) since Sat 2026-08-15 01:38:50 UTC; 22s ago
            Job: 178
     Invocation: b04231ebe66c453a96cf639be7e97fc3
           Docs: man:flatpak-preinstall(1)
        Process: 1433 ExecStart=mkdir -p /var/lib/flatpak/ (code=exited, status=0/SUCCESS)
       Main PID: 1439 (flatpak)
          Tasks: 11 (limit: 7891)
         Memory: 1.9G (peak: 1.9G)
            CPU: 21.111s
         CGroup: /system.slice/flatpak-preinstalld.service
                 └─1439 /usr/bin/flatpak preinstall -y
    
    Aug 15 01:39:11 elementary flatpak[1439]: Installing 6/24…                        0%  0 bytes/s
    Aug 15 01:39:12 elementary flatpak[1439]: Installing 6/24… ███████▏              36%
    Aug 15 01:39:12 elementary flatpak[1439]: libostree pull from 'appcenter' for app/io.elementary.camera/x86_64/stable complete
                                              security: GPG: summary+commit
                                              security: SIGN: disabled http: TLS
                                              delta: parts: 1 loose: 3
                                              transfer: secs: 0 size: 475.2 kB
    Aug 15 01:39:12 elementary flatpak[1439]: Installing 6/24… ████████████████████ 100%
    Aug 15 01:39:12 elementary flatpak[1439]: system: Pulled app/io.elementary.camera/x86_64/stable from appcenter
    Aug 15 01:39:12 elementary flatpak[1439]: system: Installed app/io.elementary.camera/x86_64/stable from appcenter
    Aug 15 01:39:12 elementary flatpak[1439]: Installing 7/24…
    Aug 15 01:39:12 elementary flatpak[1439]: Installing 7/24…                        0%  0 bytes/s
    Aug 15 01:39:12 elementary flatpak[1439]: Installing 7/24… ▌                      3%
    Aug 15 01:39:13 elementary flat
    
  17. linked a pull request that will close this issueflatpak: Explicitly preinstall GL runtime #370on Aug 16, 2026
  18. ryonakano commented on Sep 15, 2026

    @ryonakano
    Member

    Closing as completed. While it is ideal that flatpak-preinstalld.service runs when installing the default-settings package instead of first boot time, resulting the default Flatpak apps presents in the early starts up, it should be worked in another issue if we really want to do that.

  19. moved this from In progress to Done in OS 9on Sep 15, 2026
  20. removed their assignment
    on Sep 15, 2026
  21. ryonakano commented on Sep 23, 2026

    @ryonakano
    Member

    Leaving a note that I'm going to delete flatpak-stonking-patched and flatpak-stonking branches from os-patches repository and the flatpak-stonking recipe from Launchpad, because we're now importing flatpak binaries from Flatpak PPA into our os-patches PPA for the sake of elementary/os-patches#364 and those branches/recipes are no longer used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: HighTo be addressed after any critical issues

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions