Flatpak being cross-platform would seem like a good infrastructure for distributing applications offline.
Before screaming “just stay away from flatpak, bro” I know. But for the sole reason above, I went out experimenting with it to put a whole bunch of apps on a local flatpak repo on a removable media, and install them on another system.
I looked up USB Drives - Flatpak documentation and following the exact steps there, got me nowhere. I mean, while it is clear how to make a local repo with flatpak create-usb command (which may I add, has nothing to do with a USB and you can use it on any directory anywhere), it is absolutely not clear how to use it on the target system to install apps. The doc says: $ flatpak install --sideload-repo=/media/user/FLATPAKS/.ostree/repo flathub org.gnome.gedit is how you do it (with flatpak 1.8.0 and above), but what happens when you do that is it goes ONLINE to get a repo summary from flathub, and then download apps from there, even when you make sure all the apps/runtimes you’ve put in the repo using flatpak create-usb are up to date. Worse yet, it just throws an error when offline, saying failed to get summary from flathub.
Getting a little deeper into the documentation, I did the struggle as follows, Basically trying to actually add the local repo made by create-usb using flatpak remote-add.
$ flatpak --version
Flatpak 1.18.2
$ flatpak --verbose create-usb FlatRepo $(flatpak list --columns=ref)
# Too much stuff
$ ostree summary -u --repo=/run/media/rubi/Ventoy/Flatpak-repo/.ostree/repo
# No output
$ flatpak remote-ls file:///run/media/rubi/Ventoy/Flatpak-repo/.ostree/repo
Name Application ID Version Branch
Dialect app.drey.Dialect stable
g4music com.github.neithern.g4music stable
Flatseal com.github.tchx84.Flatseal stable
VideoDownloader com.github.unrud.VideoDownloader stable
bottles com.usebottles.bottles stable
Calligraphy dev.geopjr.Calligraphy stable
FlameGet io.github.C_Yassin.FlameGet stable
Cine io.github.diegopvlk.Cine stable
Hieroglyphic io.github.finefindus.Hieroglyphic stable
Warehouse io.github.flattool.Warehouse stable
varia io.github.giantpinkrobots.varia stable
mecalin io.github.nacho.mecalin stable
mundi io.github.nacho.mundi stable
Glyph io.github.shonebinu.Glyph stable
Constrict io.github.wartybix.Constrict stable
metadatacleaner io.gitlab.metadatacleaner.metadatacleaner stable
Upscaler io.gitlab.theevilskeleton.Upscaler stable
Gelly io.m51.Gelly stable
devtoolbox me.iepure.devtoolbox stable
Gahshomar org.gahshomar.Gahshomar stable
PolyMC org.polymc.PolyMC stable
waywallen org.waywallen.waywallen stable
Transition page.codeberg.grinka.Transition stable
LibreMenuEditor page.codeberg.libre_menu_editor.LibreMenuEditor stable
TAP org.freedesktop.LinuxAudio.Plugins.TAP 25.08
swh org.freedesktop.LinuxAudio.Plugins.swh 25.08
i386 org.freedesktop.Platform.Compat.i386 25.08
default org.freedesktop.Platform.GL.default 25.08
default org.freedesktop.Platform.GL.default 25.08-extra
default org.freedesktop.Platform.GL32.default 25.08
default org.freedesktop.Platform.GL32.default 25.08-extra
codecs-extra org.freedesktop.Platform.codecs-extra 25.08-extra
i386 org.freedesktop.Platform.codecs_extra.i386 25.08-extra
gnome platform org.gnome.Platform 49
gnome platform org.gnome.Platform 50
Breeze org.gtk.Gtk3theme.Breeze 3.22
kde platform org.kde.Platform 5.15-25.08
kde platform org.kde.Platform 6.10
kde platform org.kde.Platform 6.11
gecko org.winehq.Wine.gecko stable-25.08
mono org.winehq.Wine.mono stable-25.08
$ ls /run/media/rubi/Ventoy/Flatpak-repo/.ostree/repo
config extensions objects refs state summary tmp
$ flatpak remote-add --no-gpg-verify usb file:///run/media/rubi/Ventoy/Flatpak-repo/.ostree/repo
$ flatpak remote-ls usb
# No output
# I tried copying Flatpak-repo to the target system and tried again. The result is same as above.
Does anyone have any idea what in the world is the correct way to do it?
Edit: $ flatpak install --sideload-repo=/run/media/ruby/Ventoy/Flatpak-repo/.ostree/repo com.usebottles.bottles (for example) would work on the computer that has made the local repo after removing com.usebottles.bottles when offline.
It does not however, work on another system, in my case, and a realistic one, with flatpak installed and flathub configured as a remote, but no apps or runtimes has ever been installed on.