apk-add(8)
π apk add π
okay so bestie, welcome to the apk-add(8) page β the manual-name situation is handled, now let's get into the actual vibes. β¨
πΈ NAME πΈ
apk add β add or update constraints to world and commit changes π
β¨ SYNOPSIS β¨
apk add [<options>...] [constraints|file]...
π¦ DESCRIPTION π¦
okay so apk add adds or updates the constraints you give it into world (see apk-world(5) for the whole world situation) and commits changes to disk. This usually involves installing new packages, but it may also cause other changes to the installed packages. no cap. π«Ά
bestie, if you wanna upgrade individual packages without modifying world, use apk-fix(8) instead. that's the move. π
By default apk tries to select a set of packages so that all constraints are satisfied. This means that some packages can be held back in an older version if there is direct or implicit dependencies to the older version. it's giving careful resolver energy, honestly. π
If a file is added, a constraint against the package identity hash will be add. This constraint ensure that the exact file gets installed and kept. To later upgrade or downgrade back to a repository version, use apk upgrade --available. π₯
π OPTIONS π
apk add supports the commit options described in apk(8), as well as the following options:
--initdbβ Initialize a new package database. fresh start vibes β¨--latest,-lβ Always choose the latest package by version. However, the versions considered are based on the package pinning. Primarily this overrides the default heuristic and will cause an error to displayed if all dependencies cannot be satisfied. π--no-chownβ Deprecated alias for--usermode. she's retired, bestie π--upgrade,-uβ Upgrade packages and their dependencies. Normallyapk addwill avoid changing installed package unless it is required by the newly added packages or their dependencies. This changes the default preference to upgrading the package to the latest installable version. glow-up mode π₯--usermodeβ Create usermode database with--initdb. In usermode,apkwill operate in such a way that root access is not required. Currently this implies:- checking that we are running as non-root
- not changing file owner or group
- not setting system xattrs
This implies that the installation might not be fully functional. However, this is useful mode for testing purposes or to create chroot where some specific applications can run as non-root. lowkey iconic for testing π§
--virtual,-t NAMEβ Create virtual packageNAMEwith given dependencies. This new package will get the packages as dependencies instead of world. Finally theNAMEis added to world. An optional version specifier for the virtual package can be given via syntaxNAME=VERSION. The version defaults to synthesized version based on time. π°οΈ
One can use this to ensure that selected set of packages are installed, and later the temporary modification be undone with apk-del(8) NAME without removing packages that were installed earlier. temporary slay, permanent results π
xoxo, from the System Manager's Manual girlies β page apk-add(8), dated 2026-11-02 ππ«Ά
π¦ where this page comes from
- arch rolling: apk-tools 3.0.9-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms