Alpine apk¶
- ID
apk- Links
- Upstream stars
⭐ 42
- Last commit
2026-08-31
- Version requirement
>= 2.10
- Platforms
🐧 Linux
- Operations
installed·outdated·search·install·upgrade·upgrade_all·remove·sync·cleanup- purl types
pkg:apk/- CLI name
apk- Every call
apk --no-progress <command>- Issues and PRs
- Source
Alpine Package Keeper (apk) used by Alpine Linux.
What mpm adds to apk¶
Through mpm, apk gains --exact search, to narrow results to exact names.
Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover apk alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your apk commands, in mpm¶
You already know apk: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
List what’s installed |
|
|
List outdated packages |
|
|
Search for a package |
|
|
Install a package |
|
|
Upgrade one package |
|
|
Upgrade everything |
|
|
Remove a package |
|
|
Clear caches |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✅ |
|
|
✅ |
The listing reads the local repository cache rather than the remote, so run |
|
❌ |
The |
|
✅ |
Exact search backfilled by |
|
✅ |
|
|
✅ |
|
|
✅ |
|
|
✅ |
|
|
✅ |
|
|
✅ |
|
|
Configuration¶
Ignore
apkon thempmCLI by passing the--no-apkoption.Ignore it for every run in your configuration:
[mpm] apk = false
Raise the timeout of all
apkcalls:[mpm.overrides.apk] timeout = 900
Run
mpm config-template apkto print all overridable settings for your configuration file:[mpm.overrides.apk] cli_names = [ "apk", ] cli_search_path = [] dry_run = false ignore_auto_updates = true plan = false post_args = [] pre_args = [ "--no-progress", ] pre_cmds = [] requirement = ">=2.10.0" stop_on_error = false unmaintained = false version_cli_options = [ "--version", ] version_regexes = [ "apk-tools\\s+(?P<version>[^\\s,]+)", ]
The arguments and environment variables listed in the box atop this page are forced on every apk call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.
Recipes¶
A few jobs you would otherwise script around apk, one mpm command each:
Snapshot and clone a machine:
mpm --apk dump apk.toml, thenmpm restore apk.tomlon the next one.Export a compliance SBOM:
mpm --apk sbom(CycloneDX by default,--spdxfor SPDX).
Privilege escalation¶
System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.
Its privileged operations are cleanup, install, remove, sync, upgrade, upgrade_all.
See privilege escalation for the full policy.
Cooldown¶
State of Alpine apk’s release-age gating, from the cooldown support table:
Status: ❌ None
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: Distro binary archives (
pkg:deb,pkg:rpm,pkg:alpm,pkg:apk)Retraction: Index revert: removal is an archive operation and the mirror is rebuilt without the package. Debian, for one, requires filing an
RM:bug againstftp.debian.org(developers-reference)Publish date: ❌ the version string is the distro maintainer’s build, carrying no upstream publication date
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --cooldown best-effort opts back in.
Reference traces¶
A collection of raw native outputs captured from the manager’s own CLI and recorded in the manager source. If you know Alpine apk well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ apk --no-progress query --installed --fields name,version --format json '*'
[
{
"name": "alpine-base",
"version": "3.24.1-r0"
}, {
"name": "apk-tools",
"version": "3.0.8-r0"
}, {
"name": "busybox",
"version": "1.37.0-r31"
}
]
$ apk --no-progress list --installed
acl-2.2.53-r0 x86_64 {acl} (LGPL-2.1-or-later AND GPL-2.0-or-later) [installed]
alpine-baselayout-3.4.3-r1 x86_64 {alpine-baselayout} (GPL-2.0-only) [installed]
apk-tools-2.14.0-r5 x86_64 {apk-tools} (GPL-2.0-only) [installed]
busybox-1.36.1-r5 x86_64 {busybox} (GPL-2.0-only) [installed]
python3-3.11.6-r0 x86_64 {python3} (PSF-2.0) [installed]
$ apk --no-progress list --upgradable
acl-2.3.1-r0 x86_64 {acl} (LGPL-2.1-or-later) [upgradable from: acl-2.2.53-r0]
python3-3.11.7-r0 x86_64 {python3} (PSF-2.0) [upgradable from: python3-3.11.6-r0]
Version check¶
The version is probed by running:
$ apk --version
apk-tools 2.14.10, compiled for x86_64.
and extracted with:
r"apk-tools\s+(?P<version>[^\s,]+)"
Upstream project¶
Metrics |
|
|---|---|
Activity |
|
Popularity |
|
Metadata |
|
Changelog¶
8.0.0(2026-09-20)Read the installed inventory from the structured
apk queryapplet on apk-tools 3, and parse itssearchoutput, which appends each package’s description. Every result was dropped on Alpine edge.
6.4.0(2026-04-27)Add Alpine Linux’s
apkpackage manager withinstalled,outdated,search,install,upgrade,remove,sync, andcleanupsupport.