Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Useful commands for Flatpaks

Build package, that has the com.example.rdns.appname.yml file.

flatpak-builder build com.example.rdns.appname.yml --force-clean

Build package and immediately install it for use.

flatpak-builder build com.example.rdns.appname.yml --force-clean --user --install

Build package and place in a web server path.

flatpak-builder build com.example.rdns.appname.yml --force-clean --repo=/mnt/public/www/internal/repo/flatpak

Update web repo metadata.

flatpak build-update-repo --prune /mnt/public/www/internal/repo/flatpak

Install web repo from the handcrafted flatpakrepo file.

flatpak remote-add --if-not-exists --user internal http://server3/internal/repo/flatpak/internal.flatpakrepo

Update cached available-app information, like apt-get update or anything with dnf --refresh.

flatpak update internal --appstream

Search for application by name (not description).

flatpak search srb

List overall permissions for a package, including built-in and overrides.

$ flatpak info --show-permissions net.ddns.bgstack15.srbsavegameeditor 
[Context]
shared=ipc;
sockets=x11;
filesystems=xdg-desktop;xdg-documents/Snoopy vs. the Red Baron;

Unfortunately, for my sample application, the xdg-documents permission does not work.

List override permissions only, for a user, for this package.

$ flatpak override --show --user net.ddns.bgstack15.srbsavegameeditor
[Context]
filesystems=/home/bgstack15/Documents;

Grant an override filesystem permission for a flatpak.

flatpak override --user --filesystem '/home/bgstack15/Documents' net.ddns.bgstack15.srbsavegameeditor

Reset the user-level overrides for a flatpak.

flatpak override --reset --user net.ddns.bgstack15.srbsavegameeditor

Remove disused flatpak packages (mostly for runtimes).

flatpak uninstall --unused

Reference: Remove Unused Flatpak Apps To Free Up Disk Space In Linux - OSTechNix

Comments