Is there a better way to unpin many flatpak packages?

Getting several out of date package errors during Topgrade now, so I checked with flatpak uninstall --unused, and it threw me a lot of them:

These runtimes in installation ‘system’ are pinned and won’t be removed; see flatpak-pin(1):
runtime/com.obsproject.Studio.Plugin.GStreamerVaapi/x86_64/stable
runtime/com.obsproject.Studio.Plugin.Gstreamer/x86_64/stable
runtime/com.obsproject.Studio.Plugin.OBSVkCapture/x86_64/stable
runtime/io.github.dvlv.boxbuddyrs.Locale/x86_64/stable
runtime/io.github.fastrizwaan.WineZGUI.Locale/x86_64/stable
runtime/io.github.flattool.Warehouse.Locale/x86_64/stable
runtime/it.mijorus.gearlever.Locale/x86_64/stable
runtime/org.freedesktop.Platform.Compat.i386/x86_64/23.08
runtime/org.freedesktop.Platform.GL.default/x86_64/23.08
runtime/org.freedesktop.Platform.GL.default/x86_64/23.08-extra
runtime/org.freedesktop.Platform.GL32.default/x86_64/23.08
runtime/org.freedesktop.Platform.Locale/x86_64/23.08
runtime/org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/21.08
runtime/org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/23.08
runtime/org.freedesktop.Platform.VulkanLayer.OBSVkCapture/x86_64/23.08
runtime/org.freedesktop.Platform.VulkanLayer.vkBasalt/x86_64/23.08
runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/23.08
runtime/org.freedesktop.Platform.ffmpeg_full.i386/x86_64/23.08
runtime/org.freedesktop.Platform/x86_64/23.08
runtime/org.gtk.Gtk3theme.adw-gtk3-dark/x86_64/3.22
runtime/org.gtk.Gtk3theme.adw-gtk3/x86_64/3.22
runtime/org.kde.KStyle.Adwaita/x86_64/6.7
runtime/org.kde.Platform.Locale/x86_64/6.7
runtime/org.kde.Platform/x86_64/6.7
runtime/org.kde.filelight.Locale/x86_64/stable
runtime/org.kde.gwenview.Locale/x86_64/stable
runtime/org.kde.haruna.Locale/x86_64/stable
runtime/org.kde.kcalc.Locale/x86_64/stable
runtime/org.kde.okular.Locale/x86_64/stable
runtime/org.mozilla.firefox.Locale/x86_64/stable
runtime/org.winehq.Wine.DLLs.dxvk/x86_64/stable-23.08
runtime/org.winehq.Wine.gecko/x86_64/stable-23.08
runtime/org.winehq.Wine.mono/x86_64/stable-23.08

All I find online is that you have to unpin those manually, one by one?! This can’t be the intended way to deal with constantly accumulating flatpak leftovers, right? Why can’t flatpak clean up after itself?

Flatpak never removes pinned runtimes automatically to avoid breaking apps.
You must unpin them manually:

$ flatpak pin --remove --all

$ flatpak uninstall --unused

That’s the only way.

So they’re not actually safe to remove? How to avoid the growing error spam during topgrade then?

They are safe to remove once unpinned, Flatpak won’t delete anything still needed.

The spam appears because pinned runtimes can’t update.

Fix it permanently by running before Topgrade:

flatpak pin --remove --all && flatpak uninstall --unused -y

That’s it, unpin, clean, no spam.

If it is safe, why would flatpak not handle this automatically when dependencies become obsolete?

I also see some packages without version numbering:

Are they also safe to remove? Or why would they be listed as unused? Like, all those apps are still installed.

Flatpak itself doesn’t automatically pin runtimes. To my knowledge, the only runtimes that can automatically pinned are the ones you explicitly install, such as SDK extensions and probably those addons to apps.

I would wager that Universal Blue’s way of installing things has caused many of these unnecessary runtimes to be pinned.

I’m getting error: Unknown option --all