pkg.tar - pacman package archive format


A built package for the pacman package manager is a standard tarball, with optional compression. Files within the tarball are extracted to pacman’s RootDir, using the ownership and permission modes recorded in the tarball.

Files in the root of the archive which start with a dot are not extracted and are considered as packaging metadata. By convention, these files are stored as the first files in the archive, to ensure fast access when extracting metadata. The currently used metadata filenames are:


The metadata about the package itself, described below. Required.


Contains build environment information described in BUILDINFO(5). Optional.


A changelog defined in PKGBUILD(5). Optional.


An install script defined in PKGBUILD(5). Optional.


A serialized mtree(5) description of all files and file metadata provided by the package. Optional.


The metadata for a package is stored in the .PKGINFO file, formatted as key-value pairs separated by a =, one value per line. Arrays are represented as multiple keys with the same value.

Comments are supported by beginning a line with the hash (#) symbol.

Metadata is mostly taken from the PKGBUILD(5) format, but with some deviations. The full list of .PKGINFO metadata is as follows:


The name of the package. Differs from PKGBUILD(5) in that one PKGBUILD can have multiple names, one for each resulting pkg.tar. Required.


The full version of the package. Differs from PKGBUILD(5) in that it unifies the three PKGBUILD fields $epoch:$pkgver-$pkgrel. If epoch is 0 or empty, $pkgver-$pkgrel is used. Required.


The build date of the package in seconds since the epoch.


The details of the packager that built the package.


The summed size in bytes of the files installed by the package.


The architecture the package has been built for.

license (array)
replaces (array)
group (array)
provides (array)

Corresponds to the same metadata variable in PKGBUILD(5)

conflict (array)
backup (array)
depend (array)
optdepend (array)
makedepend (array)
checkdepend (array)

Corresponds to the metadata variable in PKGBUILD(5) with the same name but an s appended.


The names of files within the tarball may not contain a newline character.

Metadata cannot contain newlines.

Neither the pkgname nor pkgver may contain a slash (/) character.

The pkgname should not contain the characters =<> or the substring ': ' as this prevents it from resolving as a valid dependency for another package.