Your company here, and a link to your site. Click to find out more.

apk - Man Page

Alpine Package Keeper

Examples (TL;DR)


apk [<options>...] command [<arguments>...]


apk manages packages installed on the system. The set of top level packages to install is called the world (see apk-world(5)). apk supports various sub-commands to query and manipulate world and local & remote package repositories.


Each command is documented in detail on its manual page.

Package Installation and Removal

apk-add(8)Add packages to world and commit changes
apk-del(8)Remove packages from world and commit changes

System Maintenance

apk-fix(8)Fix, reinstall or upgrade packages without modifying world
apk-update(8)Update repository indexes
apk-upgrade(8)Install upgrades available from repositories
apk-cache(8)Manage the local package cache

Querying Package Information

apk-info(8)Give detailed information about packages or repositories
apk-list(8)List packages matching a pattern or other criteria
apk-dot(8)Render dependencies as graphviz graphs
apk-policy(8)Show repository policy for packages
apk-search(8)Search for packages by name or description

Repository Maintenance

apk-index(8)Create repository index file from packages
apk-fetch(8)Download packages from global repositories to a local directory
apk-manifest(8)Show checksums of package contents
apk-verify(8)Verify package integrity and signature


apk-audit(8)Audit system for changes
apk-stats(8)Show statistics about repositories and installations
apk-version(8)Compare package versions or perform tests on version strings

Global Options

The following options are available for all commands.

-f,  --force

Enable selected --force-* options (deprecated).

-i,  --interactive

Ask confirmation before performing certain operations.

-p,  --root <ROOT>

Manage file system at ROOT.

-q,  --quiet

Print less information.

-U,  --update-cache

Alias for '--cache-max-age 1'.

-v,  --verbose

Print more information (can be specified twice).

-V,  --version

Print program version and exit.

-X,  --repository <REPO>

Specify additional package repository. This option can be specified multiple times.


Install packages with untrusted signature or no signature.

--arch ARCH

Temporarily override architecture, to be combined with --root.

--cache-dir CACHEDIR

Temporarily override the cache directory. CACHEDIR is treated relative to the ROOT.

--cache-max-age AGE

Maximum AGE (in minutes) for index in cache before it's refreshed.


Continue even if binary data will be printed to the terminal.


Continue even if world cannot be satisfied.


Continue even if packages may be lost on reboot. This can happen when running in run-from-tmpfs mode, and installing non-repository package.


Continue even if packages use unsupported features.


Overwrite files in other packages.


Do not use cached files (local or from proxy).

--keys-dir KEYSDIR

Override directory of trusted keys. This is treated relative to ROOT.


Do not use any local cache path.


Do not use the network. The cache is still used when possible.


Disable progress bar even for TTYs.


Print default arch and exit.


Show progress.

--progress-fd FD

Write progress to the specified file descriptor.


Delete modified configuration files on package removal and uninstalled packages from cache on cache clean.

--repositories-file REPOFILE

Override system repositories, see apk-repositories(8). Specifying this option overrides the normal repositories file and repositories.d directory processing. The given REPOFILE is relative to the startup directory since apk 2.12.0_rc2.

--wait TIME

Wait for TIME seconds to get an exclusive repository lock before failing.

Commit Options

The following options are available for all commands which commit the database.

-s,  --simulate

Simulate the requested operation without making any changes.


Do not create .apk-new files in configuration directories.


Read list of overlay files from stdin. Normally this is used only during initramfs when booting run-from-tmpfs installation.


Do not execute any scripts. Useful for extracting a system image for different architecture on alternative ROOT.


Skip pre/post hook scripts (but not other scripts).


Used by initramfs when it's recreating root tmpfs. This enables selected force options to minimize failure, and disables commit hooks, among other features.


This apk has coffee making abilities.

Referenced By

apk-add(8), apk-cache(5), apk-del(8), apk-fix(8), apk-manifest(8), apk-policy(8), apk-repositories(5), apk-search(8), apk-stats(8), apk-update(8), apk-upgrade(8), apk-verify(8).