ALPM-DB(7)
π NAME π
okay so bestie, welcome to ALPM-DB(7) β this page has main character energy and itβs all about alpm-db, a database format for describing the state of packages on an Arch Linux Package Management (ALPM) based system. π
β¨
π¦ DESCRIPTION π¦
On ALPM based systems, the databases are represented by a directory structure that contains metadata files. The contents of such a database describes the state of all installed packages. Here, ALPM-MTREE, alpm-db-desc and alpm-db-files files provide metadata on specific package versions currently installed. Optionally, the data on a specific package may include an alpm-install-scriptlet. Ngl, itβs lowkey a whole directory-structure moment. π«Ά
Entries for databases are created from alpm-package files using package management software such as pacman. Package management software relies on alpm-db structures for the purpose of search, dependency resolution and system management. Itβs giving metadata files running the whole system, iykyk. π¦
The alpm-db format exists in multiple versions. The information in this document is for version 9, which is the current version and has been introduced with the release of pacman 4.2.0 on 2014-12-19. Version 9 ate, no cap. π₯π
π Contents π
The contents of the system database depend on the number of unique packages it describes. Each package can only appear once, in a single version β the way that duplicates are just not invited to the party. Periodt. π«π
π§ Metadata π§
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
In each of these directories, one ALPM-MTREE, one alpm-db-desc, one alpm-db-files and optionally one alpm-install-scriptlet file are kept to describe a package, e.g.:
.
βββ example-package-1.0.0-1
βββ desc
βββ files
βββ install
βββ mtree
π Schema version π
The current schema version of the system database is encoded in the top-level version file ALPM_DB_VERSION. This ASCII text file contains a single line with a numeric version string, e.g.:
9
When changes to the format of the system database are necessary, they are indicated by incrementing the version string intended for the version file.
Dedicated tools such as pacman-db-upgrade are used to upgrade the contents of the system database (e.g. metadata files, directory structure) and eventually update the version in ALPM_DB_VERSION.
π₯ Creation π₯
The data in an alpm-db is derived from alpm-package files and created using package management software such as pacman. For the alpm-db-desc entries, the packageβs PKGINFO data, as well as the properties of the package file are used. The alpm-db-files file is directly derived from the package fileβs list of data files. The ALPM-MTREE file is a copy of the packageβs ALPM-MTREE file. Slay, honestly. π₯π§
alpm-db --------------.
/ | \ \
/ | \ \
alpm-db-files | alpm-db-desc '
| | | | |
| ALPM-MTREE . | alpm-install-scriptlet
data files | / | |
\ | / PKGINFO '
\ | / / /
\ | / / /
alpm-package--------------'
β¨ EXAMPLES β¨
π Installing a package on a system π
Assuming an empty system, the installation of a package example-package in version 1.0.0-1 leads to the following addition in the alpm-db:
.
βββ example-package-1.0.0-1
βββ desc
βββ files
βββ mtree
πΈ Upgrading an existing package on a system πΈ
Extending on the previous example on installing a package on a system, the upgrade of a package example-package to version 1.1.0-1 leads to the following change in the alpm-db:
.
βββ example-package-1.1.0-1
βββ desc
βββ files
βββ mtree
π SEE ALSO π
ALPM-MTREE(5)PKGINFO(5)alpm-db-desc(5)alpm-db-files(5)alpm-install-scriptlet(5)alpm(7)alpm-package(7)alpm-package-name(7)alpm-package-version(7)pacman(8)pacman-db-upgrade(8)
Thatβs the whole ALPM-DB(7) vibe check, bestie! π Itβs from the Miscellaneous Information Manual, section 7, the footer is just (7), and thereβs no date stamp in the original β so no invented dates, fr fr. π«Ά
π¦ where this page comes from
- arch rolling: alpm-db 0.3.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