pkg.add
[ -u ]
[ -f ]
[ -r
root ]
[ -c
config ]
package.pkg.tar.*
pkg.add
installs a binary package archive into the system.
It reads the package database, checks for conflicts, extracts
files, and updates the database.
The installation sequence is:
1. Parse archive (name, version, file list) 2. Check for conflicts with installed packages 3. Load install rules from pkg.add.conf(5) 4. Extract metadata — create groups/users (before extraction) 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 metadataGroups and users declared in the package metadata are created
before
file extraction so that files can reference the correct ownership. Services arenot
automatically enabled on install — the symlink is not created by pkg.add.-r root, --root root-c config, --config configpkg.add
processes the following directives:
group entrypermission entrycapability entrylibcap to be installed on the system. If setcap is not found, a warning is printed and the entry is skipped.pkg.add
runs cache-regeneration triggers based on installed file paths:
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-databaseTriggers fire at most once per install regardless of how many files match. If the trigger command is not installed, it is silently skipped.
PKG_ROOTPKG_DBDIRTMPDIR0
on success,
1
on error.