Install and remove
apk add <pkg>
Install a package
apk add <pkg1> <pkg2>
Install several packages
apk add --no-cache <pkg>
Install, skip the local index cache
The standard form in Dockerfiles: no apk update step and no
cache left in the image.
apk del <pkg>
Remove a package and unused deps
apk del -r <pkg>
Also remove packages depending on it
apk add -t <name> <pkg>...
Group packages as a virtual package
apk del <name>
Remove a virtual package and its deps
apk add <pkg>=<version>
Install a specific version
apk add <pkg>~=<version>
Install a fuzzy version match
apk add <pkg>@<tag>
Install from a tagged repository
apk add -u <pkg>
Upgrade a package if installed
apk add cmd:<command>
Install whichever package provides a command
apk add so:<library>
Install by shared library name
apk add pc:<name>
Install by pkg-config module
apk add --allow-untrusted <file>.apk
Install a local, unsigned package
apk add -s <pkg>
Simulate an install
apk add
Reconcile installed packages with the world file
Search and inspect
apk search <name>
Search package names
apk search -e <name>
Search for an exact name
apk search -d <text>
Search descriptions
apk search -v <name>
Show versions and descriptions
apk search cmd:<command>
Find the package providing a command
apk search so:<library>
Find the package providing a library
apk info <pkg>
Show package details
apk info
List installed packages
apk list -I
List installed packages with versions
apk info -L <pkg>
List files in a package
apk info -W <path>
Find the package owning a file
apk info -e <pkg>
Check whether a package is installed
apk info -R <pkg>
List a package's dependencies
apk info -r <pkg>
List packages depending on it
apk policy <pkg>
Show available versions and repos
apk list -O
List orphaned packages
Cache and world
apk cache clean
Delete outdated cached packages
apk cache -v sync
Sync cache with the world file
apk cache download
Download packages into the cache
apk fetch <pkg>
Download a package without installing
apk audit
List changed files under /etc
cat /etc/apk/world
Show explicitly installed packages
ls /etc/apk/cache
Inspect the package cache
update-conf
Merge .apk-new config files
Package upgrades leave a .apk-new file when you modified the
config; update-conf walks you through them.
apk stats
Show package database statistics