I’m having trouble with an offline install of my application.
I build my application, which goes fine:
$ flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir com.example.hello.yml
$ flatpak run com.example.hello
Before I create-usb, I add collection-id to the remotes:
$ flatpak remote-modify --collection-id=org.flathub.Stable flathub
$ flatpak remote-modify --collection-id=com.example.Stable hello-origin
$ flatpak remotes --columns=name,collection
Name Collection ID
flathub org.flathub.Stable
hello-origin com.example.Stable
I think create-usb, which seems to go ok:
$ mkdir FLATPAKS
$ flatpak create-usb ./FLATPAKS com.example.hello
Warning: Couldn't update appstream data for remote ‘hello-origin’ arch ‘x86_64’: Error updating appstream2: No such ref 'appstream2/x86_64' in remote hello-origin; Error updating appstream: No such ref 'appstream/x86_64' in remote hello-origin
Warning: Couldn't find appstream data for remote ‘hello-origin’ arch ‘x86_64’: Refspec 'hello-origin:appstream2/x86_64' not found; Refspec 'hello-origin:appstream/x86_64' not found
Writing objects: 1
Writing objects: 1
1806 metadata, 6010 content objects imported; 830.7 MB content written
Writing objects: 2984
Writing objects: 1
Copied 5/5 refs successfully from ‘/home/xxx/.local/share/flatpak/repo’ to ‘.ostree/repo’ repository in ‘./FLATPAKS’.
8 metadata, 8 content objects imported; 75.9 MB content written
$ flatpak remote-ls file:///home/xxx/test2/FLATPAKS/.ostree/repo/
Name Application ID Version Branch
hello com.example.hello master
default org.freedesktop.Platform.GL.default 23.08
default org.freedesktop.Platform.GL.default 23.08-extra
freedesktop platform org.freedesktop.Platform 23.08
To test it, on the same machine, I delete the application, and the remote:
$ flatpack uninstall –y --all
$ flatpak remote-delete flathub
Then I go into a fresh directory and try to install from my repo
$ mkdir $/test3
$ cd ~/test3
$ flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak remote-add --if-not-exists --user --no-gpg-verify my_repo file:///home/xxx/test2/FLATPAKS/.ostree/repo
$ flatpak remote-modify --collection-id=org.flathub.Stable flathub
$ flatpak remote-modify --collection-id=com.example.Stable my_repo
$ flatpak install --sideload-repo=/home/xxx/test2/FLATPAKS/.ostree/repo my_repo com.example.hello
Looking for matches…
error: Nothing matches com.example.hello in remote my_repo
I also tried
$ flatpak install --sideload-repo=/home/xxx/test2/FLATPAKS/.ostree/repo flathub com.example.hello
If I follow similar steps for some application already in flathub, like “gedit”, it works fine.
What am I doing wrong?
Thanks,
Chris