ALPM-REPO-DB(7)
π alpm-repo-db(7) π
okay bestie, welcome to alpm-repo-db(7) from the Miscellaneous Information Manual β this is literally the blueprint for how ALPM-based package repositories spill their metadata tea. no cap, every deet matters here. π
β¨ NAME β¨
alpm-repo-db β a database format for describing the metadata of Arch Linux Package Management (ALPM) based package repositories. π«Ά
πΈ DESCRIPTION πΈ
Repository databases are (optionally compressed) tar archives that contain directories and metadata files. The contents of such a database describe the state of an ALPM package repository (alpm-repo). Here, the alpm-repo-desc and alpm-repo-files files provide metadata on specific package versions currently considered in a package repository. β¨
Repository database files are created from alpm-package files using package repository management software (e.g. dbscripts[1] which relies on repo-add). π«Ά
Package management software (e.g. pacman) relies on alpm-repo-db files for the purpose of search, dependency resolution and download of package files. π₯
In some contexts, repository databases may be referred to as repository sync databases or repository metadata. iykyk. π
π¦ Variants π¦
Two variants of repository databases exist: default and default with files. Both are valid, bestie.
- default: The database contains one
alpm-repo-descfile peralpm-packagein the repository. This repository database variant allows package management software to query relevant metadata for search and download of package files from a repository. - default with files: The database contains one
alpm-repo-descand onealpm-repo-filesfile peralpm-packagein the repository. In addition to querying relevant metadata for search and download of package files from a repository, this repository database variant allows package management software to search through a simple file list per package. π
π Format π
Uncompressed repository database files in the variant default follow the following naming scheme:
An alpm-repo-name directly followed by the string .db.tar (e.g. repo.db.tar). π«Ά
Uncompressed repository database files in the variant default with files follow the following naming scheme:
An alpm-repo-name directly followed by the string .files.tar (e.g. repo.files.tar). π«Ά
π Compression π
Repository databases may optionally be compressed using a single supported compression technology. If an alpm-repo-db is compressed, a technology-specific suffix is appended to the file name. Obsessed with these suffixes, honestly:
.Zβ compression based on adaptive Lempel-Ziv coding (e.g.repo.db.tar.Z, orrepo.files.tar.Z), see thecompresscommand.bz2β bzip2 compression (e.g.repo.db.tar.bz2, orrepo.files.tar.bz2).gzβ gzip compression (e.g.repo.db.tar.gz, orrepo.files.tar.gz).lrzβ lrzip compression (e.g.repo.db.tar.lrz, orrepo.files.tar.lrz).lz4β lz4 compression (e.g.repo.db.tar.lz4, orrepo.files.tar.lz4).lzβ lzip compression (e.g.repo.db.tar.lz, orrepo.files.tar.lz).lzoβ lzop compression (e.g.repo.db.tar.lzo, orrepo.files.tar.lzo).xzβ xz compression (e.g.repo.db.tar.xz, orrepo.files.tar.xz).zstβ zstd compression (e.g.repo.db.tar.zst, orrepo.files.tar.zst)
Handling of compression technologies is specific to the package repository management tool. π
π Digital signatures π
Digital signatures can be created for repository database files. β¨
Currently, only OpenPGP signatures[2] over the repository database file are supported. Detached signatures carry the same name as the repository database file for which they are created, with an additional .sig suffix (e.g. repo.db.tar.zst.sig is the digital signature for a repository database file repo.db.tar.zst). π₯
π Symlinks π
For each variant of a repository database as well as for each of their digital signatures, a symlink is created, that represents an archive and compression agnostic file name. So true.
.
βββ repo.db -> repo.db.tar.gz
βββ repo.db.sig -> repo.db.tar.gz.sig
βββ repo.db.tar.gz
βββ repo.db.tar.gz.sig
βββ repo.files -> repo.files.tar.gz
βββ repo.files.sig -> repo.files.tar.gz.sig
βββ repo.files.tar.gz
βββ repo.files.tar.gz.sig
These file names are used by package management software to download package repository databases regardless of compression algorithms, which allows to change them on the fly. slay. π¦
π¦ Contents π¦
The contents of a repository database depend on the database variant and the number of unique alpm-package files in the alpm-repo it describes. Here, each package can only be present in a single version in the repository database. Important, bestie. In both variants, metadata of a package is kept in a top-level directory, that is named after the package and its specific version. The name follows this schema:
An alpm-package-name directly followed by a - sign, directly followed by an alpm-package-version (in the full or full with epoch form), e.g.:
example-package-1.0.0-1example-package-1:1.0.0-1
π Default π
The default repository database variant keeps one alpm-repo-desc file per package in the repository database, e.g.:
.
βββ example-package-1.0.0-1
βββ desc
πΈ Default with files πΈ
The default with files repository database variant keeps one alpm-repo-desc and one alpm-repo-files file per package in the repository database, e.g.:
.
βββ example-package-1.0.0-1
βββ desc
βββ files
π§ Creation π§
ALPM repository databases are created using one or more alpm-package files and their respective optional digital signatures. For the alpm-repo-desc entries, the packageβs PKGINFO data, as well as the properties of the package file and its optional digital signature are used. The alpm-repo-files file is directly derived from the package fileβs list of data files. Here's the whole flow, literally:
alpm-package - - - - digital signature
/ | \ /
data files PKGINFO \ /
/ \ \ /
/ \ \ /
| \ | /
| alpm-repo-db \ | /
| / \ | | /
alpm-repo-files alpm-repo-desc
π EXAMPLES π
πΈ Adding a package to an empty repository database πΈ
Given a repository named repo and a package named example-package, the following example explores the use and transformation of metadata when adding a package to a package repository. π«Ά
Assuming to start off with an empty package repository, the repository databases will exist already:
.
βββ repo.db -> repo.db.tar.gz
βββ repo.db.sig -> repo.db.tar.gz.sig
βββ repo.db.tar.gz
βββ repo.db.tar.gz.sig
βββ repo.files -> repo.files.tar.gz
βββ repo.files.sig -> repo.files.tar.gz.sig
βββ repo.files.tar.gz
βββ repo.files.tar.gz.sig
The repo repository does not contain any packages yet, both repo.db.tar.gz and repo.files.tar.gz are empty. π
First, the package file and its digital signature are put into the repository directory to bring it into scope:
.
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst.sig
βββ repo.db -> repo.db.tar.gz
βββ repo.db.sig -> repo.db.tar.gz.sig
βββ repo.db.tar.gz
βββ repo.db.tar.gz.sig
βββ repo.files -> repo.files.tar.gz
βββ repo.files.sig -> repo.files.tar.gz.sig
βββ repo.files.tar.gz
βββ repo.files.tar.gz.sig
Repository management software is then used to add example-package to the repository database. Here, the contents of the repository database variants are changed and their respective digital signatures updated. β¨
The default repository database will contain:
.
βββ example-package-1.0.0-1
βββ desc
The default with files repository database will contain:
.
βββ example-package-1.0.0-1
βββ desc
βββ files
Only now, package management software is made aware of the package example-package in version 1.0.0-1 in the package repository repo, after downloading the updated repository database. periodt. π
π¦ Updating a package in a repository database π¦
Extending on the above example of adding a package to an empty repository database, the following example illustrates updating package metadata in a repository database. Assuming to start off with a package repository repo, that already contains the package example-package in version 1.0.0-1, the repository directory should look something like this:
.
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst.sig
βββ repo.db -> repo.db.tar.gz
βββ repo.db.sig -> repo.db.tar.gz.sig
βββ repo.db.tar.gz
βββ repo.db.tar.gz.sig
βββ repo.files -> repo.files.tar.gz
βββ repo.files.sig -> repo.files.tar.gz.sig
βββ repo.files.tar.gz
βββ repo.files.tar.gz.sig
The default repository database will contain:
.
βββ example-package-1.0.0-1
βββ desc
The default with files repository database will contain:
.
βββ example-package-1.0.0-1
βββ desc
βββ files
If the package example-package receives an upgrade (e.g. for version 1.1.0-1), this new package file and its corresponding digital signature are copied to the repository directory:
.
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst
βββ example-package-1.0.0-1-x86_64.pkg.tar.zst.sig
βββ example-package-1.1.0-1-x86_64.pkg.tar.zst
βββ example-package-1.1.0-1-x86_64.pkg.tar.zst.sig
βββ repo.db -> repo.db.tar.gz
βββ repo.db.sig -> repo.db.tar.gz.sig
βββ repo.db.tar.gz
βββ repo.db.tar.gz.sig
βββ repo.files -> repo.files.tar.gz
βββ repo.files.sig -> repo.files.tar.gz.sig
βββ repo.files.tar.gz
βββ repo.files.tar.gz.sig
At this point, both repository database variants still advertise the package example-package in version 1.0.0-1. However, the package files and digital signatures of both version 1.0.0-1 and version 1.1.0-1 are present in the repository directory. no cap. π
Repository management software is then used to add example-package in version 1.1.0-1 to the repository database. As only one version of example-package may exist in a given repository database, the metadata for 1.0.0-1 is removed. π₯
The default repository database will contain:
.
βββ example-package-1.1.0-1
βββ desc
The default with files repository database will contain:
.
βββ example-package-1.1.0-1
βββ desc
βββ files
π SEE ALSO π
ok so like, the whole alpm cinematic universe is out there and you are not alone on this journey bestie π here's everyone who's in the group chat with alpm-repo-db:
bzip2(1)β compression core, the OGscompress(1)β the vintage one, respect the eldersgzip(1)β the classic, never not relevantlrzip(1)β for when your files are huge hugelz4(1)β speed demon energy fr frlzip(1)β lzma's quirky cousinlzop(1)β lowkey retro compression vibespkgctl(1)β the tool that actually does the work, main charactertar(1)β the archiver that raised us allxz(1)β big squeeze, big slayzstd(1)β fast and small, ate and left no crumbsPKGINFO(5)β the package metadata file formatalpm-repo-desc(5)β thedescfile format, iconicalpm-repo-files(5)β thefilesfile format, also iconicalpm-package(7)β what a package even isalpm-package-name(7)β the rules for package namesalpm-package-version(7)β the rules for package versionsalpm-repo(7)β repo concepts 101alpm-repo-name(7)β the rules for repo namespacman(8)β the moment, the legend, the reason you're hererepo-add(8)β the tool that builds the db
like bestie, if you're confused, literally just click through the whole set, the info is all connected π¦
π NOTES π
ok so here's the receipts, the source material, the "iykyk" section π
- dbscripts
https://gitlab.archlinux.org/archlinux/dbscripts
- OpenPGP signatures
https://openpgp.dev/book/signing_data.html#detached-signatures
bestie pls note: the second one is specifically about detached signatures, so don't skip that part of the anchor, that's the whole point π
aaaaand that's the page!! π you made it to the end, so proud of you π«Ά the lil (7) sitting at the bottom is your sign-off note that this whole thing lives in section 7 of the manual β the alpm-repo-db(7) page, exactly as it shipped in this man page source. go read the rest of the alpm set and treat yourself, you've earned it β¨π
π¦ where this page comes from
- arch rolling: alpm-repo-db 0.2.0-1 Β· Apache-2.0 OR MIT AND CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms