Ideas for improving the experience with flatpak packages in Ubuntu

At the moment, the experience of using flatpak packages in Ubuntu is not the best.

On the Flathub page it is suggested to install gnome-software-plugin-flatpak, which installs GNOME Software. In this configuration, GNOME Software duplicates the work of the standard updater (doing offline system updates) and the Snap Store, which handles the rest.

From here, I suggest two ways to fix this:

1. Recommend to deleting Snap Store. Thus, all the work (snap packages, flatpak packages, deb packages, system updates) will be performed by GNOME Software.

Of the minuses, I would note that in this case, people will not get the experience of using the new Snap Store, they can do offline updates instead of the usual one, and there will also be more reasons to continue to support the snap package plugin for GNOME Software (as far as I can tell from this correspondence , it was proposed for removal and the only limiting factor was the unknown state of the new store at the time of the decision).

2. Adapt GNOME Software to the ability to use only flatpak packages. openSUSE MicroOS successfully practices this.

In this option, one of the downsides is that it will be necessary to adapt the gnome-software package (either create a gnome-software-only-flatpak package, or when installing the flatpak plugin, install GNOME Software and plugin only), and the user will also have 2 stores, which may confuse some.


In my opinion, the best option is the 2nd option. It is less labor-intensive in the long run, and also allows users of flatpak packages not to deprive themselves of a new Ubuntu store (if they are concerned about duplication of work, of course).

How do you think the experience can be improved for version 22.04 and in future releases?

5 Likes

I would agree that 1) is not ideal, as it would downgrade the store experience for new users. As I understand it one of the reasons for making the new (flutter) store was to get away from the slowness and bloat of GNOME Software.

  1. feels less than ideal, as it intentionally cripples GNOME Software to do less. However, if (as you suggest) it were forked to gnome-software-flatpak-only (or whatever name), which only had the ability to do flatpaks, then I agree that could be a good compromise. If it could get in the archive for 22.04, even better, and potentially could be put in a PPA for older releases, making it more consistent across any supported Ubuntu release.
4 Likes

The DEB/PackageKit ability of Gnome Software could be made optional (eg it will be an extra package gnome-software-deb). So someone could use Gnome Software only for flatpaks, if wanted.

However I personally avoid flatpaks on Ubuntu, because they integrate bad with Ubuntu in general.

1 Like

I’m curious, other than the GUI store experience, what have you found that integrates poorly? I’m using several Flatpak-distributed programs on Ubuntu 23.10, and they seem to behave fine to me?

I would like to emphasize that I was referring to the adaptation of gnome-software to be used, among other things, including as an only-flatpak store. It seems that in the original text the translator made a little sense mistake…

As a result, if you have experience with deb packages, what would be better and generally possible: create a gnome-software-only-flatpak package that contains an exact copy of gnome-software, but fully configured to work only with flatpak packages, or split up the original gnome-software so that when installing gnome-software-plugin-flatpak, was a pure gnome-software + flatpak plugin installed?

The first option in this case seems to be as simple as possible… however, then there will be 2 identical packages from the same source code in the repository (as I understand), and the second one is more complex, since I need to work out dependencies and the like, but more correct.

I have no experience with deb packages (came from the rpm world), so few little hints would be good fuel for further advancement :slight_smile:

1 Like

Can I ask in which specific places flatpak does not integrate well with Ubuntu?

This topic is dedicated to ideas on how to improve the experience with flatpak, so it would be very useful to know what problems you are having :slight_smile:

Cannot this be the other way around (as GNOME Software is a performance nightmare), the new and well performing flutter Ubuntu store would handle it all?
Was it ever a consideration? For new and average users’ sake, those who decline on using terminal to search and install Flatpak applications, of course.

I guess everyone else could be just fine with a flatpak install…command. No?

I have no idea, legit question.

1 Like

A while back, this was asked on an issue. Short answer: “no”.

The Ubuntu main distro and all the flavours do not ship with flatpak support out of the box, by policy. As such, the app centre won’t support it either. So that’s a closed-off avenue that I suspect the OP of this thread already knew and was looking for alternative options for.

2 Likes

To be fair, it seemed to me (and not only me) that the performance of GNOME Software, for the most part, depends on plugins.

PackageKit plugin (and PackageKit itself) is considered, to put it mildly, not the best software.

Hence, the speed of GNOME Software without PackageKit plugin, working exclusively with the flatpak plugin, can pleasantly surprise.

1 Like

One other massive issue with gnome-softwares design was that it actually runs a permanent daemon in background eating resources (I haven’t seen the source but I guess it is partially to overcome the overall slowness) … so you would add this bit back to the desktop sessions of users…

But disregarding these drawbacks I personally think having a cut down version of the tool called “flatpak store” (or something similar along these lines) would make an awesome community project, showing the interest of the ubuntu community in that package format…

4 Likes

Thank you for your answers

I have personally two issues with flatpaks on Ubuntu 23.10:

  • The Yaru Theme is not always adopted, e.g. in the Gnote flatpak
  • Flatpak apps only appear in the Gnome App Grid after system reboot

OpenSUSE outsourced the PackageKit ability of Gnome Software into an extra optional package, so this could be also possible for Ubuntu/Debian.

e.g. OpenSUSE Aeon uses the Gnome Software store just for flatpak, without the PackageKit ability.

2 Likes

Only if a) they installed it, and b) launched it. I wouldn’t make it autostart like Ubuntu did, to counter the super-slow first launch time.

Oh…so not true. I use quite a few flatpak applications (Apostrophe, Lollypop, Geany, etc) on both, Fedora and Ubuntu and they always appeared staright after installations ended. No reboot was ever necessary.

Could that be referring to the experience when first installing Flatpak overall, perhaps, where in my experience apps don’t start correctly and a reboot is required?

Regardless, the question may come down to whether there is sufficient interest among the intersection of folks who A) can/do contribute to Ubuntu B) want to promote a native GUI app store for Flatpak, vs. just directing folks to flathub.org and having them browse there / use the CLI install commands you get there?

I am posting this here because could not fully master the creation deb packages and PPA. I stumbled too many times (and still stumble) on those things that I didn’t even think about while preparing rpm packages fixes for openSUSE and Fedora and burned out.

Patch for GNOME Software from 22.04, which separate some associations like the last version one.

file.patch
diff -ruN a/contrib/gnome-software.spec.in b/contrib/gnome-software.spec.in
--- a/contrib/gnome-software.spec.in	2022-03-18 11:09:27.885578000 +0300
+++ b/contrib/gnome-software.spec.in	2023-10-24 18:02:56.123336857 +0300
@@ -134,7 +134,9 @@
 %doc AUTHORS README.md
 %license COPYING
 %{_bindir}/gnome-software
-%{_datadir}/applications/gnome-software-local-file.desktop
+%{_datadir}/applications/gnome-software-local-file-flatpak.desktop
+%{_datadir}/applications/gnome-software-local-file-fwupd.desktop
+%{_datadir}/applications/gnome-software-local-file-packagekit.desktop
 %{_datadir}/applications/org.gnome.Software.desktop
 %dir %{_datadir}/gnome-software
 %{_datadir}/gnome-software/*.png
diff -ruN a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in	2022-03-18 11:09:27.916578000 +0300
+++ b/po/POTFILES.in	2023-10-24 18:04:07.883802228 +0300
@@ -2,7 +2,10 @@
 data/org.gnome.software.external-appstream.policy.in.in
 data/org.gnome.software.gschema.xml
 gs-install-appstream/gs-install-appstream.c
-src/gnome-software-local-file.desktop.in
+src/gnome-software-local-file-flatpak.desktop.in
+src/gnome-software-local-file-fwupd.desktop.in
+src/gnome-software-local-file-packagekit.desktop.in
+src/gnome-software-local-file-snap.desktop.in
 src/gs-age-rating-context-dialog.c
 src/gs-age-rating-context-dialog.ui
 lib/gs-app.c
diff -ruN a/src/gnome-software-local-file.desktop.in b/src/gnome-software-local-file.desktop.in
--- a/src/gnome-software-local-file.desktop.in	2022-03-18 11:09:27.977578000 +0300
+++ b/src/gnome-software-local-file.desktop.in	1970-01-01 03:00:00.000000000 +0300
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Name=Software Install
-Comment=Install selected software on the system
-Categories=System;
-Exec=gnome-software --local-filename %f
-Terminal=false
-Type=Application
-# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=system-software-install
-StartupNotify=true
-NoDisplay=true
-MimeType=application/x-rpm;application/x-redhat-package-manager;application/x-deb;application/x-app-package;application/vnd.ms-cab-compressed;application/vnd.flatpak;application/vnd.flatpak.repo;application/vnd.flatpak.ref;application/vnd.snap;
diff -ruN a/src/gnome-software-local-file-flatpak.desktop.in b/src/gnome-software-local-file-flatpak.desktop.in
--- a/src/gnome-software-local-file-flatpak.desktop.in	1970-01-01 03:00:00.000000000 +0300
+++ b/src/gnome-software-local-file-flatpak.desktop.in	2023-10-24 18:05:49.084373977 +0300
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Software Install
+Comment=Install selected software on the system
+Categories=System;
+Exec=gnome-software --local-filename %f
+Terminal=false
+Type=Application
+Icon=system-software-install
+StartupNotify=true
+NoDisplay=true
+MimeType=application/vnd.flatpak;application/vnd.flatpak.repo;application/vnd.flatpak.ref;
diff -ruN a/src/gnome-software-local-file-fwupd.desktop.in b/src/gnome-software-local-file-fwupd.desktop.in
--- a/src/gnome-software-local-file-fwupd.desktop.in	1970-01-01 03:00:00.000000000 +0300
+++ b/src/gnome-software-local-file-fwupd.desktop.in	2023-10-24 18:06:46.776667203 +0300
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Software Install
+Comment=Install selected software on the system
+Categories=System;
+Exec=gnome-software --local-filename %f
+Terminal=false
+Type=Application
+Icon=system-software-install
+StartupNotify=true
+NoDisplay=true
+MimeType=application/vnd.ms-cab-compressed;
diff -ruN a/src/gnome-software-local-file-packagekit.desktop.in b/src/gnome-software-local-file-packagekit.desktop.in
--- a/src/gnome-software-local-file-packagekit.desktop.in	1970-01-01 03:00:00.000000000 +0300
+++ b/src/gnome-software-local-file-packagekit.desktop.in	2023-10-24 18:08:01.889022804 +0300
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Software Install
+Comment=Install selected software on the system
+Categories=System;
+Exec=gnome-software --local-filename %f
+Terminal=false
+Type=Application
+Icon=system-software-install
+StartupNotify=true
+NoDisplay=true
+MimeType=application/x-rpm;application/x-redhat-package-manager;application/x-deb;application/vnd.debian.binary-package;application/x-app-package;
diff -ruN a/src/gnome-software-local-file-snap.desktop.in b/src/gnome-software-local-file-snap.desktop.in
--- a/src/gnome-software-local-file-snap.desktop.in	1970-01-01 03:00:00.000000000 +0300
+++ b/src/gnome-software-local-file-snap.desktop.in	2023-10-24 18:09:02.153291454 +0300
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Software Install
+Comment=Install selected software on the system
+Categories=System;
+Exec=gnome-software --local-filename %f
+Terminal=false
+Type=Application
+Icon=system-software-install
+StartupNotify=true
+NoDisplay=true
+MimeType=application/vnd.snap;
diff -ruN a/src/meson.build b/src/meson.build
--- a/src/meson.build	2022-03-18 11:09:27.994578000 +0300
+++ b/src/meson.build	2023-10-24 18:10:08.565574348 +0300
@@ -213,14 +213,49 @@
   install_dir: join_paths(get_option('datadir'), 'applications')
 )
 
-i18n.merge_file(
-  input: 'gnome-software-local-file.desktop.in',
-  output: 'gnome-software-local-file.desktop',
-  type: 'desktop',
-  po_dir: join_paths(meson.source_root(), 'po'),
-  install: true,
-  install_dir: join_paths(get_option('datadir'), 'applications')
-)
+if get_option('flatpak')
+  i18n.merge_file(
+    input: 'gnome-software-local-file-flatpak.desktop.in',
+    output: 'gnome-software-local-file-flatpak.desktop',
+    type: 'desktop',
+    po_dir: join_paths(meson.project_source_root(), 'po'),
+    install: true,
+    install_dir: join_paths(get_option('datadir'), 'applications')
+  )
+endif
+
+if get_option('fwupd')
+  i18n.merge_file(
+    input: 'gnome-software-local-file-fwupd.desktop.in',
+    output: 'gnome-software-local-file-fwupd.desktop',
+    type: 'desktop',
+    po_dir: join_paths(meson.project_source_root(), 'po'),
+    install: true,
+    install_dir: join_paths(get_option('datadir'), 'applications')
+  )
+endif
+
+if get_option('packagekit') or get_option('rpm_ostree')
+  i18n.merge_file(
+    input: 'gnome-software-local-file-packagekit.desktop.in',
+    output: 'gnome-software-local-file-packagekit.desktop',
+    type: 'desktop',
+    po_dir: join_paths(meson.project_source_root(), 'po'),
+    install: true,
+    install_dir: join_paths(get_option('datadir'), 'applications')
+  )
+endif
+
+if get_option('snap')
+  i18n.merge_file(
+    input: 'gnome-software-local-file-snap.desktop.in',
+    output: 'gnome-software-local-file-snap.desktop',
+    type: 'desktop',
+    po_dir: join_paths(meson.project_source_root(), 'po'),
+    install: true,
+    install_dir: join_paths(get_option('datadir'), 'applications')
+  )
+endif
 
 install_data('org.gnome.Software-search-provider.ini',
              install_dir : 'share/gnome-shell/search-providers')

I also attach the modified control file for 22.04, which seems to handle dependencies correctly (but not tested):

control
Source: gnome-software
Section: gnome
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
Uploaders: @GNOME_TEAM@
Build-Depends: debhelper-compat (= 13),
               dh-sequence-gnome,
               docbook-xsl,
               gsettings-desktop-schemas-dev (>= 3.18),
               gtk-doc-tools,
               libappstream-dev (>= 0.14.0),
               libflatpak-dev (>= 1.0.4) [amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x hppa powerpc powerpcspe ppc64],
               libfwupd-dev (>= 1.0.3) [linux-any],
               libglib2.0-dev (>= 2.56.0),
               libgnome-desktop-3-dev (>= 3.18.0),
               libgspell-1-dev,
               libgtk-3-dev (>= 3.22.4),
               libgudev-1.0-dev [linux-any],
               libhandy-1-dev (>= 1.2.0),
               libjson-glib-dev (>= 1.2.0),
               libostree-dev [linux-any],
               libmalcontent-0-dev [amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x hppa powerpc powerpcspe ppc64],
               libpackagekit-glib2-dev (>= 1.1.11),
               libpolkit-gobject-1-dev,
               libsnapd-glib-dev (>= 1.54) [amd64 arm64 armel armhf i386 ppc64el s390x],
               libsoup2.4-dev (>= 2.52.0),
               libxml2-utils,
               libxmlb-dev (>= 0.1.7),
               meson (>= 0.47),
               pkg-config,
               policykit-1,
               valgrind [amd64 arm64 armhf i386 mips mips64 mips64el mipsel powerpc ppc64 ppc64el s390x],
               xsltproc
Build-Depends-Indep: libgdk-pixbuf2.0-doc <!nodoc>,
                     libglib2.0-doc <!nodoc>,
                     libgtk-3-doc <!nodoc>,
                     libjson-glib-doc <!nodoc>,
                     libsoup2.4-doc <!nodoc>
Rules-Requires-Root: no
Standards-Version: 4.6.0
XS-Debian-Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-software
XS-Debian-Vcs-Git: https://salsa.debian.org/gnome-team/gnome-software.git
Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-software/-/tree/ubuntu/jammy
Vcs-Git: https://salsa.debian.org/gnome-team/gnome-software.git -b ubuntu/jammy
Homepage: https://wiki.gnome.org/Apps/Software
X-Ubuntu-Use-Langpack: yes

Package: gnome-software
Architecture: any
Depends: apt-config-icons,
         gnome-software-common (= ${source:Version}),
         gsettings-desktop-schemas (>= 3.18),
         libgtk3-perl,
         software-properties-gtk,
         ${misc:Depends},
         ${shlibs:Depends}
Conflicts: sessioninstaller
Recommends: fwupd [linux-any], ${plugin:Recommends}
Suggests: apt-config-icons-hidpi,
          gnome-software-plugin-flatpak [amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x hppa powerpc powerpcspe ppc64],
          ${plugin:Suggests}
Description: Software Center for GNOME
 Software lets you install and update applications and system extensions.
 .
 Software uses a plugin architecture to separate the frontend from the
 technologies that are used underneath. Currently, a PackageKit plugin provides
 data from a number of traditional packaging systems, such as rpm or apt. An
 appdata plugin provides additional metadata from locally installed data in the
 appdata format.

Package: gnome-software-common
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}
Description: Software Center for GNOME (common files)
 Software lets you install and update applications and system extensions.
 .
 Software uses a plugin architecture to separate the frontend from the
 technologies that are used underneath. Currently, a PackageKit plugin provides
 data from a number of traditional packaging systems, such as rpm or apt. An
 appdata plugin provides additional metadata from locally installed data in the
 appdata format.
 .
 This package contains the architecture-independent files.

Package: gnome-software-plugin-flatpak
Architecture: amd64 arm64 armel armhf hppa i386 mips mipsel mips64el powerpc powerpcspe ppc64 ppc64el s390x
Depends: flatpak,
         gnome-software (= ${binary:Version}),
         ${misc:Depends},
         ${shlibs:Depends}
Description: PackageKit support for GNOME Software
 Software lets you install and update applications and system extensions.
 .
 Software uses a plugin architecture to separate the frontend from the
 technologies that are used underneath. Currently, a PackageKit plugin provides
 data from a number of traditional packaging systems, such as rpm or apt. An
 appdata plugin provides additional metadata from locally installed data in the
 appdata format.
 .
 This package contains the Flatpak plugin.
 
Package: gnome-software-plugin-packagekit
Architecture: amd64 arm64 armel armhf hppa i386 mips mipsel mips64el powerpc powerpcspe ppc64 ppc64el s390x
Depends: packagekit (>= 1.1.11),
         appstream,
         gnome-software (= ${binary:Version}),
         ${misc:Depends},
         ${shlibs:Depends}
Description: PackageKit support for GNOME Software
 Software lets you install and update applications and system extensions.
 .
 Software uses a plugin architecture to separate the frontend from the
 technologies that are used underneath. Currently, a PackageKit plugin provides
 data from a number of traditional packaging systems, such as rpm or apt. An
 appdata plugin provides additional metadata from locally installed data in the
 appdata format.
 .
 This package contains the PackageKit plugin.

Package: gnome-software-plugin-snap
Architecture: amd64 arm64 armel armhf i386 ppc64el s390x
Depends: gnome-software (= ${binary:Version}),
         snapd [amd64 arm64 armel armhf i386 ppc64el],
         ${misc:Depends},
         ${shlibs:Depends}
Recommends: snapd [s390x]
Breaks: gnome-software (<< 3.22.3)
Replaces: gnome-software (<< 3.22.3)
Description: Snap support for GNOME Software
 Software lets you install and update applications and system extensions.
 .
 Software uses a plugin architecture to separate the frontend from the
 technologies that are used underneath. Currently, a PackageKit plugin provides
 data from a number of traditional packaging systems, such as rpm or apt. An
 appdata plugin provides additional metadata from locally installed data in the
 appdata format.
 .
 This package contains the Snap plugin.

Package: gnome-software-dev
Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libappstream-dev (>= 0.14.0),
         libglib2.0-dev (>= 2.56.0),
         libgtk-3-dev (>= 3.22.4),
         libsoup2.4-dev (>= 2.52.0),
         ${misc:Depends}
Suggests: gnome-software-doc
Description: Software Center for GNOME - development files
 Software lets you install and update applications and system extensions.
 .
 This package contains headers and other files required when compiling external
 plugins for use with Software.

Package: gnome-software-doc
Section: doc
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}
Build-Profiles: <!nodoc>
Description: Software Center for GNOME - documentation
 Software lets you install and update applications and system extensions.
 .
 This package contains documentation for use when developing plugins for
 Software.

I hope that someone who has more experience and/or time, and has the desire to help improve the experience with flatpak on Ubuntu, will be able to finish it and release it.

I have landed the GNOME Software app packaging split as suggested here in Debian Unstable and have requested a Feature Freeze Exception to get this work into Ubuntu 24.04 LTS also.

Thank you for your proposal which helped to make Ubuntu better.

5 Likes