FLATPAK-BUILD-EXPORT(1)
π FLATPAK-BUILD-EXPORT π
okay so bestie, this is the flatpak build-export page from the flatpak manual β section 1, commands-and-tools territory, and it's literally the moment your build dir becomes a real, shareable repo. slay. let's go. β¨
πΈ NAME πΈ
flatpak-build-export β create a repository from a build directory. yes that's the whole job. that's the vibe. π
π SYNOPSIS π
flatpak build-export [OPTION...] LOCATION DIRECTORY [BRANCH]
π¦ DESCRIPTION π¦
So here's the tea: this command creates or updates a repository with an application build. π«Ά
LOCATIONβ the location of the repository.DIRECTORYβ must be a finalized build directory. (finalized!! don't skip that part, it's giving unfinished-business otherwise π)BRANCHβ if it's not specified, it's assumed to be"master".
If LOCATION already exists, it's assumed to be an OSTree repository. Otherwise a brand new OSTree repository gets created at that location. You can go peek at the repository with the ostree tool, like a little vibe check. π
The contents of DIRECTORY are committed on the branch with the name:
app/APPNAME/ARCH/BRANCH
where ARCH is the architecture of the runtime that the application is using. A commit filter is used to enforce that only the contents of the files/ and export/ subdirectories and the metadata file are included in the commit. Anything else is ignored. periodt. π
When you're exporting a flatpak to be published to the internet, --collection-id=COLLECTION-ID should be specified as a globally unique reverse DNS value, to identify the collection of flatpaks this will be added to. Setting a globally unique collection ID lets the apps in the repository be shared over peer to peer systems without needing further configuration. iconic behaviour tbh. β¨
π‘ bestie note: the build-update-repo command should be used to update repository metadata whenever application builds are added to a repository. don't forget it, it's the main character of repo maintenance.
β¨ OPTIONS β¨
The following options are understood β and yes, we're listing ALL of them, no skipping, no cap. π
-h,--helpβ show help options and exit. the classic escape hatch. πͺ-s,--subject=SUBJECTβ one line subject for the commit message.-b,--body=BODYβ full description for the commit message.--collection-id=COLLECTION-IDβ set as the collection ID of the repository. Setting a globally unique collection ID allows the apps in the repository to be shared over peer to peer systems without needing further configuration. But heads up: if you're exporting to an existing repository, the collection ID must match the existing configured collection ID for that repository. no mismatches, we don't do that here. π--subset=SUBSETβ mark the commit to be included in the named subset. This will cause the commit to be put in the named subset summary (in addition to the main one), allowing users to see only this subset instead of the whole repo. lowkey a curation moment. π--arch=ARCHβ specify the architecture component of the branch to export. Only host compatible architectures can be specified; seeflatpak --supported-archesfor valid values.--exclude=PATTERNβ exclude files matchingPATTERNfrom the commit. This option can be used multiple times.--include=PATTERNβ don't exclude files matchingPATTERNfrom the commit, even if they match the--excludepatterns. This option can be used multiple times.--metadata=FILENAMEβ use the specified filename as metadata in the exported app instead of the default file (calledmetadata). This is useful if you want to commit multiple things from a single build tree, typically used in combination with--filesand--exclude. multi-purpose build tree, we love to see it. π--files=SUBDIRβ use the files in the specified subdirectory as the file contents, rather than the regularfilesdirectory.--timestamp=DATEβ use the specified ISO 8601 formatted date orNOW, for the current time, in the commit metadata and, if--update-appstreamis used, the appstream data.--end-of-life=REASONβ mark the build as end-of-life.REASONis a message that may be shown to users installing this build. it's giving farewell tour. π₯--end-of-life-rebase=IDβ mark the build as end-of-life. Unlike--end-of-life, this one takes an ID that supersedes the current one. By the user's request, the application data may be preserved for the new application.--disable-fsyncβ don't fsync when writing to the repository. This can result in data loss in exceptional situations, but can improve performance when working with temporary or test repositories.--update-appstreamβ update the appstream branch after the build.--no-update-summaryβ don't update the summary file after the new commit is added. This means the repository will not be useful for serving over http untilbuild-update-repohas been run. This is useful is you want to do multiple repo operations before finally updating the summary.--gpg-sign=KEYIDβ sign the commit with this GPG key. This option can be used multiple times.--gpg-homedir=PATHβ GPG Homedir to use when looking for keyrings-r,--runtimeβ export a runtime instead of an app (this uses theusrsubdir asfiles).-v,--verboseβ print debug information during command processing.--ostree-verboseβ print OSTree debug information during command processing.
π§ EXAMPLES π§
here's the moment you've been waiting for, bestie:
$ flatpak build-export ~/repos/gnome-calculator/
~/build/gnome-calculator/ org.gnome.Calculator
Commit: 9d0044ea480297114d03aec85c3d7ae3779438f9d2cb69d717fb54237acacb8c
Metadata Total: 605
Metadata Written: 5
Content Total: 1174
Content Written: 1
Content Bytes Written: 305
look at that commit hash. ate and left no crumbs. π
π SEE ALSO π
go read these next, they're all in the friend group:
ostree(1)flatpak(1)flatpak-build-init(1)flatpak-build(1)flatpak-build-finish(1)flatpak-build-sign(1)flatpak-build-update-repo(1)
okay that's the whole page, you're officially a build-export girlie now π«Ά this manual came from the flatpak project and lives in the FLATPAK BUILD-EXPOR(1) manual β go forth, export your builds, and slay. πβ¨π
π¦ where this page comes from
- debian trixie: flatpak 1.16.6-1~deb13u3
- fedora 44: flatpak 1.18.4-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: flatpak 1.18.4-1.fc44 Β· LGPL-2.1-or-later
- nixpkgs unstable: flatpak 1.18.4
- ubuntu stonking: flatpak 1.18.4-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms