apk-cache(8)
π apk-cache β the manual page, but make it group chat
okay so real talk, this one lives in section 8 of the System Manager's Manual and it's called apk-cache. It's the page about managing your local cache of package files β yes bestie, the little stash of .apk files your system keeps so it doesn't have to re-download everything like a clown every single time. iconic behavior honestly.
β¨ SYNOPSIS β¨
Four ways to summon it, pick your fighter:
apk cache [<options>...] clean
apk cache [<options>...] download [dependency...]
apk cache [<options>...] purge
apk cache [<options>...] sync [dependency...]
πΈ DESCRIPTION πΈ
So what is this even doing. The whole ~vibe~ of apk cache is: manage your local package cache by removing obsolete packages, or by downloading missing or newer packages from the repositories. That's it, that's the job. Clean up the stale stuff, pull down the fresh stuff.
π apk cache download
This one will fetch package files from the repositories and store them in the cache β but heads up, the cache must be enabled upfront (go peek at apk-cache(5) for that, iykyk). By default, world dependencies are what determines which packages get downloaded. But if you pass dependency arguments? Then those will, by default, replace the world. So like, you're not adding to the list, you're swapping it out. periodt.
π§Ή apk cache clean
apk cache clean removes package files which no longer exist in any repository index. Basically it's the "you don't sit with us anymore" sweep for packages that have fully left the building.
And if you specify the global option --purge? Then it additionally removes:
- all uninstalled package on tmpfs installations, and
- all packages on disk installations.
careful bestie β that --purge addition is doing a LOT more than the base command. It's not a little tidy-up anymore, it's a full clear-out. Know which kind of installation you're on before you go there π.
ποΈ apk cache purge
Short and sweet: apk cache purge is a synonym for clean --purge. Same energy, fewer words. slay.
π apk cache sync
apk cache sync performs both operations β the clean and the download, together, in one go. the way that it just does everything for you π«Ά
π OPTIONS π
Every single flag, no skipping, we don't do that here:
--add-dependenciesβ Adds the argument dependencies to the world dependencies when it's figuring out which packages to download. So instead of replacing the world, you're topping it up. very "and also this" of it.--available,-aβ Selects packages to be downloaded from the active repositories even if that means replacing or downgrading the installed package. Yes, downgrading. It's committed to the bit.--ignore-conflictβ Ignores conflicts when resolving dependencies. Genuinely useful when you're pre-populating the cache to create multiple images in one go β it lets you batch that whole situation without the resolver getting in your way.--latest,-lβ Always choose the latest package by version. But β and this is the important bit β the versions considered are based on the package pinning. Primarily this overrides the default heuristic, and it will cause an error to be displayed if all dependencies cannot be satisfied. So it's the "I want the newest one and I accept the consequences" flag π₯.--upgrade,-uβ When caching packages that are already installed, it prefers their upgrades rather than considering the requirement fulfilled by the current installation. Basically: don't just shrug and say "you already have it," go get the newer one.--simulate[=BOOL],-sβ Simulates the requested operation without making any changes. The dress rehearsal. The vibe check before the real thing. Use it, honestly, it's free π
π a little sign-off π
This whole page comes from the System Manager's Manual β specifically apk-cache(8) β and it's dated 2026-11-02. That's the source, the version, the date, the whole provenance package, wrapped up with a bow π go forth and cache responsibly bestie πβ¨
π¦ where this page comes from
- arch rolling: apk-tools 3.0.9-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms