addpkg

install or upgrade a package

Synopsis

addpkg [ -u ] [ -f ] [ -r root ]

package.pkg.tar.*

Description

addpkg installs a binary package archive into the system. The installation sequence is:
1. Parse archive (name, version, file list)
2. Check footprint against .footprint (if present)
3. Check for conflicts with installed packages
4. Create groups and users from package metadata
5. Extract archive to root
6. Remove orphaned files (on upgrade)
7. Update package database
8. Run ldconfig and triggers
9. Apply file permissions from metadata
10. Apply file capabilities from metadata
Groups and users are created

before

file extraction so that installed files can reference the correct ownership.

Options

-u
Upgrade an existing package. Files in the old version absent from the new one are removed. Existing configuration files under etc/ are preserved; the new version is placed alongside as file.new .
-f
Force installation, overwriting conflicting files. On a same-version reinstall, existing etc/ files are left untouched; missing ones are installed.
-r root
Install to an alternative root directory.

Footprint Guard

If a

.footprint

file exists in the same directory as the package archive, addpkg compares the archive contents against it before installing. New files (present in archive but absent from .footprint ) are reported as:
addpkg: footprint: new
<file list>
addpkg: footprint: error
Installation is blocked unless IGNORE_NEW=yes is set in /etc/mkpkg.conf , in which case new files are silently accepted. Use -f to bypass the footprint check entirely. Missing files (in

.footprint

but absent from archive) always block installation regardless of IGNORE_NEW .

Etc/ Handling

Fresh install
Configuration files under etc/ are extracted normally.
Same-version reinstall (-f)
Existing etc/ files are skipped. Missing ones are installed.
Upgrade (-u)
Existing etc/ files are installed as file.new for manual review. Missing ones are installed normally.

Package Metadata

If the package contains a metadata file at var/lib/pkg/meta/ , the following directives are processed:
group entry
Create a system group and optionally a user. See MAKEPKG(5).
permission entry
Apply ownership and mode after extraction. Format: /path:owner:group:mode .
capability entry
Apply file capabilities after extraction using setcap (8). Format: /path:capabilities .

Triggers

After extraction, addpkg runs cache-regeneration triggers:
usr/share/fonts/            -> fc-cache -s
usr/share/glib-2.0/schemas/ -> glib-compile-schemas
usr/lib/gdk-pixbuf-2.0/     -> gdk-pixbuf-query-loaders
usr/share/mime/             -> update-mime-database
usr/share/icons/            -> gtk-update-icon-cache
usr/share/applications/     -> update-desktop-database
Each trigger fires at most once per install. Missing trigger commands are silently skipped.

Environment

PKG_ROOT
Alternative installation root (same as -r ).

Files

/var/lib/pkg/db
Package database.
/var/lib/pkg/meta/
Per-package metadata files.
/etc/mkpkg.conf
Build and install configuration. See mkpkg.conf(5).

Exit Status

0 on success, 1 on error.

See Also

LLVM musl libc libressl Independent