DNF5-CACHING(7)
β¨ DNF5-CACHING(7) β¨
okay bestie, welcome to dnf5-caching β the manual page for dnf5 that's all about caching πΎβ¨ (yes, the manual name is right there in the title, we're already iconic)
πΈ NAME πΈ
dnf5-caching β Caching π
π DESCRIPTION π
So like, this page is here to give you the whole ~tour~ of the different instruments DNF5 has for messing with cached data, plus the scenarios where you'd actually use them. We're talking configuration options, command-line parameters, and commands, all of it π«Ά
π CACHED DATA LOCATION π
here's the vibe of a typical DNF5 cache directory, bestie:
/var/cache/libdnf5/
βββ fedora-*
β βββ metalink.xml
β βββ repodata
β β βββ *-comps-Everything.x86_64.xml
β β βββ *-primary.xml.zck
β β βββ repomd.xml
β βββ solv
β βββ fedora-group.solvx
β βββ fedora.solv
βββ temporary_files.toml
βββ updates-*
βββ metalink.xml
βββ packages
β βββ bash-5.2.21-1.fc38.x86_64.rpm
βββ repodata
β βββ *-primary.xml.zck
β βββ *-updateinfo.xml.zck
β βββ *-comps-Everything.x86_64.xml.gz
β βββ repomd.xml
βββ solv
βββ updates-group.solvx
βββ updates-updateinfo.solvx
βββ updates.solv
The default root cache directory is /var/cache/libdnf5, periodt. But β plot twist β when DNF5 runs as another user, it pulls the cache from ~/.cache/libdnf5 instead, same structure and everything. And if you wanna change things up? The root cache directory can be redefined with the system_cachedir configuration option, and the user cachedir with the cachedir option. slay π
Inside that cache directory there are subdirectories for each configured repository, like fedora-* and updates-*. Those hold metadata files in the repodata directory, and solver-generated cached files in the solv directory. Those solver files? They're there to make resolving package dependencies (or running queries) way faster π₯ and you can turn them on or off per repository with the build_cache configuration option. The packages directory may store downloaded packages from a repository, and a metalink or mirrorlist file tells you where the remote locations of the repository data are.
Oh and also β the root cache directory has a temporary_files.toml file in it, which is all about temporarily stored packages on the system π
π¦ METADATA TYPES π¦
There are several types of metadata that get downloaded from remote locations and processed in DNF5, bestie. Let's break it down π«
Some metadata is mandatory and always considered. The main repository metadata file, repomd.xml, holds info about specific metadata type files related to a repository β checksums, file sizes, and where they live in the metadata hierarchy. Another mandatory file is the primary metadata file, which gives you the detailed tea on available packages: package names, versions, dependencies, etc. And modules metadata is also downloaded and processed. no skips π
Other metadata types are optional and can be loaded into DNF5 in these ways:
- Explicit user request, by adding the requested type to the
optional_metadata_typesconfiguration option - Automatically during runtime, depending on the CLI command used
- For filelists metadata, when the user passes any filepath argument
Here's the list of supported optional metadata types, in all their glory:
- comps: Metadata containing package groups and environment descriptions
- filelists: Information about all files provided by packages
- updateinfo: Security-related updates and advisories information
- presto: Information related to delta RPMs
- other: Additional metadata, such as changelogs
And if the required metadata isn't present on the system? That can lead to different scenarios β like returning an empty query, an error output for no match for an argument, or an error when resolving a transaction π fair warning fr fr
π CACHING PACKAGES π
By default, DNF5 does not cache downloaded package data, because the keepcache option is set to False. With that setting, every single time DNF5 downloads a package from a remote location, it tracks it inside temporary_files.toml in the repository cache directory. Then, after the next successful transaction run, all those files get removed based on that list. This only happens when the transaction contains any inbound action β otherwise, packages are retained, because potential use cases, yk? π
When keepcache is set to True, downloaded files are not tracked, and they could be removed later β either manually or by running the clean command, for example, dnf5 clean packages.
Also important bestie: packages are always retained when downloaded using the download command. no takebacks π
π§ SHARING ROOT CACHE AMONG USERS π§
Typically DNF5 is run with superuser privileges so it can make system changes. But there are scenarios where just running queries without elevated privileges is enough. In those cases, we might need to download the entire repository metadata for the user account from the remote β even if there's already existing data in the root's cache. awkward π
So here's what DNF5 does: when checking for empty, expired, or invalid repository metadata while running under a non-root account, it first examines the root's location. If metadata is present there, it gets copied over to the user cache location. And ngl, this cloning of metadata is optimized when copy-on-write functionality is present on the filesystem β like with btrfs. ate β¨
π CACHEONLY OPTION VS PARAMETER π
To tell DNF5 to operate exclusively with cached data and avoid downloads from remote locations, you've got two instruments available, bestie:
- The
cacheonlyconfiguration option β where you can specify either metadata (use only repository metadata from the cache) or all (include the entire cache, disallowing any package downloads). - The
--cacheonlyparameter β when this is employed, it automatically sets the configuration option to all, resulting in a fully cache-driven operation.
Using the metadata value for the cacheonly configuration can be a whole advantage when optional repositories are temporarily unavailable, or when we already know they're unnecessary for our current use case. It's also useful when cached metadata isn't the latest or has expired β but is still functional. lowkey the move π
π DELETE, CREATE, UPDATE π
These commands are the ones you want for manual cache deletion and creation:
dnf5-clean(8), Clean command<#clean-command-ref-label>dnf5-makecache(8), Makecache command<#makecache-command-ref-label>
And to force a metadata update before executing a command, just use the --refresh parameter. main character energy π₯
π Author π
See AUTHORS.md in dnf5 source distribution.
π Copyright π
Contributors to the dnf5 project.
okay that's the whole page bestie, you're officially a caching expert π and if you wanna know where all this came from: this is dnf5 source/version DNF5-CACHING(7), dated Sep 24, 2026 β mwah, go forth and cache responsibly πβ¨π¦
π¦ where this page comes from
- fedora 44: dnf5 5.4.6.0-1.fc44 Β· GPL-2.0-or-later
- fedora 44: dnf5 5.4.6.0-1.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms