NAME
ALPM-MTREE - Package directory hierarchy description format.
DESCRIPTION
The mtree format is a textual format that describes the hierarchy and metadata of files in a directory.
mtree is a well-known format that can, for example, be used for installation instructions or to verify files' metadata and the hierarchy of a directory.
The ALPM-MTREE format adheres to the official mtree specification.
However mtree
files in the scope of ALPM only use a subset of all fields supported by the official mtree:
use-set
type
uid
gid
mode
time
size
sha256
link
In Pacman ALPM-MTREE files are solely used to verify that installed files are identical to the original files without having to keep the original package around.
.MTREE files are implicitly generated and included when creating packages via makepkg
.
The gzip-compressed .MTREE file is located in the root of ALPM based packages
The ALPM-MTREE format exists in multiple versions. The information in this document is for version 2, which is the current version. It has been introduced with the release of pacman 6.1.0 on 2024-03-04.
Changes since the last version
The md5 field has been removed, effectively making this a breaking change.
EXAMPLES
#mtree
/set type=file uid=0 gid=0 mode=644
./.BUILDINFO time=1696727741.0 size=5574 sha256digest=708be566788a6a2712bcd40425d93761569ede07371781374edb1f22e2a3eb96
./.PKGINFO time=1696727741.0 size=830 sha256digest=3aa17bec02b34c157e7c739c62e0e37a9d19f1459d404d7c6f2c14c6008127cd
/set mode=755
./usr time=1731613789.0 type=dir
./usr/bin time=1731613789.0 type=dir
./usr/bin/resolvconf time=1731613789.0 mode=777 type=link link=resolvectl
Generation
ALPM's mtree files are generated by calling:
bsdtar \
--format=mtree \
--options='!all,use-set,type,uid,gid,mode,time,size,sha256,link' \
$folder
Usages
In the context of ALPM and pacman
, the mtree
file's main purpose is to provide a performant way of getting a package's file metadata without having to extract and read the whole package.
This data is then used to verify installed files on the target system against the original files from the package.
Take a look at pacman
's query check functionality for more detail.
SEE ALSO
mtree(5), pacman(8)