.\" Generated by scdoc 1.11.5 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "apk\-add" "8" "2026\-10\-27" .PP .SH NAME .PP apk add \- add or update constraints to \fIworld\fR and commit changes .PP .SH SYNOPSIS .PP \fBapk add\fR [<\fIoptions\fR>.\&.\&.\&] \fIconstraints\fR.\&.\&.\& .PP .SH DESCRIPTION .PP \fBapk add\fR adds or updates given constraints to \fIworld\fR (see \fBapk\-world\fR(5)) and commit changes to disk.\& This usually involves installing new packages, but may also cause other changes to the installed packages.\& .PP To upgrade individual packages without modifying \fIworld\fR use \fBapk\-fix\fR(8).\& .PP By default \fBapk\fR 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.\& .PP .SH OPTIONS .PP \fBapk add\fR supports the commit options described in \fBapk\fR(8), as well as the following options: .PP \fB\-\-initdb\fR .RS 4 Initialize a new package database.\& .PP .RE \fB\-l, \-\-latest\fR .RS 4 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.\& .PP .RE \fB\-u, \-\-upgrade\fR .RS 4 Upgrade \fIpackages\fR and it'\&s dependencies.\& Normally \fBapk add\fR will avoid changing installed package unless it is required by the newly added \fIpackages\fR or their dependencies.\& This changes the default preference to upgrading the package to the latest installable version.\& .PP .RE \fB\-t, \-\-virtual\fR \fINAME\fR .RS 4 Create virtual package \fINAME\fR with given dependencies.\& This new package will get the \fIpackages\fR as dependencies instead of \fIworld\fR.\& Finally the \fINAME\fR is added to \fIworld\fR.\& An optional version specifier for the virtual package can be given via syntax \fINAME\fR=\fIVERSION\fR.\& The version defaults to synthesized version based on time.\& .PP One can use this to ensure that selected set of packages are installed, and later the temporary modification be undone with \fBapk\-del\fR(8) \fINAME\fR without removing packages that were installed earlier.\& .PP .RE \fB\-\-no\-chown\fR .RS 4 Do not change file owner or group.\& By default apk will manage the file ownership when running as root.\& However, this option is turned on when running as non\-root user, as changing file ownership is not permitted by the system then.\& .RE