LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

apk

Alpine Linux package manager

TLDR

Refresh the package index
$ apk update
copy
Install packages
$ apk add [package1] [package2]
copy
Install without leaving an index cache behind, as in a Dockerfile
$ apk add --no-cache [package]
copy
Install build dependencies under a virtual name
$ apk add --virtual [.build-deps] [gcc] [make]
copy
Drop that whole group again in one command
$ apk del [.build-deps]
copy
Upgrade everything after refreshing the index
$ apk upgrade --update-cache
copy
Preview a change without applying it
$ apk add --simulate [package]
copy
Search by name, listing descriptions
$ apk search --verbose [keyword]
copy
Search inside descriptions
$ apk search --description [keyword]
copy
Show a package's details
$ apk info [package]
copy
Find which package owns a file
$ apk info --who-owns [/usr/bin/ssh]
copy
List the files a package installed
$ apk info --contents [package]
copy
List everything installed
$ apk list --installed
copy
Repair a package without touching its dependencies
$ apk fix [package]
copy

SYNOPSIS

apk [options] command [arguments]

DESCRIPTION

apk (Alpine Package Keeper) is the package management tool for Alpine Linux. It handles installation, upgrade, and removal of packages, as well as repository management and system maintenance.

PARAMETERS

add

Add or modify constraints and commit changes
del
Remove constraints and commit changes
fix
Fix, reinstall, or upgrade packages without modifying world
update
Update repository indexes
upgrade
Install upgrades available from repositories
cache
Manage the local package cache
search
Search for packages by name or description
info
Display detailed information about packages
list
List packages matching a pattern or criteria
query
Interrogate installed database and indexes
policy
Show repository policy for packages
version
Compare package versions or check for available upgrades
fetch
Download packages from repositories to the current directory
stats
Show statistics about the package database
-U, --update-cache
Update package lists before the operation (alias for --cache-max-age 0)
-v, --verbose
Print more verbose information (repeat for more detail)
-q, --quiet
Print less information
-d, --description
Search in package descriptions
--no-cache
Do not use or update any local cache; fetch the index directly
--allow-untrusted
Install packages with untrusted or missing signatures
-X, --repository url
Specify a supplemental repository
-p, --root dir
Manage a filesystem rooted at the given directory

CONFIGURATION

/etc/apk/repositories

List of package repository URLs, one per line.
/etc/apk/world
List of explicitly installed packages and version constraints.
/etc/apk/keys/
Directory containing trusted repository signing keys.

INSTALL

sudo dnf install apk-tools
copy
sudo pacman -S apk-tools
copy
sudo apk add apk-tools
copy
sudo zypper install apk-tools
copy
nix profile install nixpkgs#apk-tools
copy

CAVEATS

Alpine Linux specific; not available on other distributions. Uses a minimal package format designed for size and simplicity.

HISTORY

Developed for Alpine Linux, a security-oriented, lightweight Linux distribution. Alpine is widely used in container environments due to its small footprint.

SEE ALSO

apt(8), dnf(8), pacman(8)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid