Debian Codegraph @

upstream/mageia-cauldron/man7/dnf5-caching.7

raw
1 .\" Man page generated from reStructuredText.
2 .
3 .
4 .nr rst2man-indent-level 0
5 .
6 .de1 rstReportMargin
7 \\$1 \\n[an-margin]
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10 -
11 \\n[rst2man-indent0]
12 \\n[rst2man-indent1]
13 \\n[rst2man-indent2]
14 ..
15 .de1 INDENT
16 .\" .rstReportMargin pre:
17 . RS \\$1
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
21 ..
22 .de UNINDENT
23 . RE
24 .\" indent \\n[an-margin]
25 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26 .nr rst2man-indent-level -1
27 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29 ..
30 .TH "DNF5-CACHING" "7" "May 10, 2026" "" "dnf5"
31 .SH NAME
32 dnf5-caching \- Caching
33 .SH DESCRIPTION
34 .sp
35 This page aims to provide an overview of the various instruments, such as configuration options,
36 command\-line parameters, and commands, available in DNF5 for manipulating cached data and
37 their associated scenarios.
38 .SH CACHED DATA LOCATION
39 .sp
40 Following directory structure illustrates a typical DNF5 cache directory:
41 .INDENT 0.0
42 .INDENT 3.5
43 .sp
44 .EX
45 /var/cache/libdnf5/
46 ├── fedora\-*
47 │\ \ ├── metalink.xml
48 │\ \ ├── repodata
49 │\ \ │\ \ ├── *\-comps\-Everything.x86_64.xml
50 │\ \ │\ \ ├── *\-primary.xml.zck
51 │\ \ │\ \ └── repomd.xml
52 │\ \ └── solv
53 │\ \ ├── fedora\-group.solvx
54 │\ \ └── fedora.solv
55 ├── temporary_files.toml
56 └── updates\-*
57 ├── metalink.xml
58 ├── packages
59 │\ \ └── bash\-5.2.21\-1.fc38.x86_64.rpm
60 ├── repodata
61 │\ \ ├── *\-primary.xml.zck
62 │\ \ ├── *\-updateinfo.xml.zck
63 │\ \ ├── *\-comps\-Everything.x86_64.xml.gz
64 │\ \ └── repomd.xml
65 └── solv
66 ├── updates\-group.solvx
67 ├── updates\-updateinfo.solvx
68 └── updates.solv
69 .EE
70 .UNINDENT
71 .UNINDENT
72 .sp
73 The default root cache directory is \fB/var/cache/libdnf5\fP, but when DNF5 runs as another user,
74 it uses the cache from \fB~/.cache/libdnf5\fP with the same structure. The root cache
75 directory can be redefined using the \fBsystem_cachedir\fP configuration option, and the user
76 cachedir with the \fBcachedir\fP option.
77 .sp
78 Within the cache directory, there are subdirectories corresponding to each configured repository,
79 such as \fBfedora\-*\fP and \fBupdates\-*\fP\&. These contain metadata files in the \fBrepodata\fP directory
80 and solver\-generated cached files in the \fBsolv\fP directory. The solver files, used to enhance
81 performance in resolving package dependencies or running queries, can be enabled or disabled on
82 a repository level through the \fBbuild_cache\fP configuration option. The \fBpackages\fP directory
83 may store downloaded packages from a repository, and a \fBmetalink\fP or \fBmirrorlist\fP file provides
84 information on the remote locations of the repository data.
85 .sp
86 Additionally, the root cache directory contains a \fBtemporary_files.toml\fP file related to
87 temporarily stored packages in the system.
88 .SH METADATA TYPES
89 .sp
90 There are several types of metadata downloaded from remote locations and processed in DNF5.
91 .sp
92 Some metadata is mandatory and always considered. The main repository metadata file, \fBrepomd.xml\fP,
93 contains information about specific metadata type files related to a repository, such as checksums,
94 file sizes, and their locations in the metadata hierarchy. Another mandatory file is the \fBprimary\fP
95 metadata file, providing detailed information about available packages, including package names,
96 versions, dependencies, etc. If DNF5 is compiled with modularity support, \fBmodules\fP metadata is
97 also downloaded and processed.
98 .sp
99 Other metadata types are optional and can be loaded into DNF5 in the following ways:
100 .INDENT 0.0
101 .IP \(bu 2
102 Explicit user request by adding the requested type to the \fBoptional_metadata_types\fP configuration option
103 .IP \(bu 2
104 Automatically during runtime, depending on the CLI command used
105 .IP \(bu 2
106 For \fBfilelists\fP metadata, when the user passes any filepath argument
107 .UNINDENT
108 .sp
109 Here is the list of supported optional metadata types:
110 .INDENT 0.0
111 .IP \(bu 2
112 \fBcomps\fP: Metadata containing package groups and environment descriptions
113 .IP \(bu 2
114 \fBfilelists\fP: Information about all files provided by packages
115 .IP \(bu 2
116 \fBupdateinfo\fP: Security\-related updates and advisories information
117 .IP \(bu 2
118 \fBpresto\fP: Information related to delta RPMs
119 .IP \(bu 2
120 \fBother\fP: Additional metadata, such as changelogs
121 .UNINDENT
122 .sp
123 If the required metadata is not present in the system, it can result in different scenarios,
124 such as returning an empty query, error output for no match for an argument, or an error when
125 resolving a transaction.
126 .SH CACHING PACKAGES
127 .sp
128 By default, DNF5 does not cache downloaded package data, as the \fBkeepcache\fP option is configured
129 to \fBFalse\fP\&. With this setting, every time DNF5 downloads a package from the remote location,
130 it tracks it within the \fBtemporary_files.toml\fP in the repository cache directory. After the next
131 successful transaction run, all the files are removed based on this list. This process occurs only
132 when the transaction contains any inbound action; otherwise, packages are retained, considering
133 potential use cases.
134 .sp
135 When the keepcache option is set to \fBTrue\fP, downloaded files are not tracked, and they could be
136 removed later, either manually or by executing the \fBclean\fP command, for example,
137 \fBdnf5 clean packages\fP\&.
138 .sp
139 Packages are always retained when downloaded using the \fBdownload\fP command.
140 .SH SHARING ROOT CACHE AMONG USERS
141 .sp
142 Typically, DNF5 is run with superuser privileges to make system changes. However, there are
143 scenarios where executing queries without elevated privileges is sufficient. In such cases,
144 we may need to download the entire repository metadata for the user account from the remote,
145 even if there is existing data in the root\(aqs cache.
146 .sp
147 In DNF5, when checking for empty, expired, or invalid repository metadata while running under
148 a non\-root account, we first examine the root\(aqs location. If metadata is present there, it is
149 copied to the user cache location. Note that this cloning of metadata is optimized when
150 copy\-on\-write functionality is present on the filesystem, such as with btrfs.
151 .SH CACHEONLY OPTION VS PARAMETER
152 .sp
153 To instruct DNF5 to operate exclusively with cached data, avoiding downloads from remote locations,
154 two instruments are available. First, using the \fBcacheonly\fP configuration option, we can specify
155 either \fBmetadata\fP to utilize only repository metadata from the cache or \fBall\fP to include
156 the entire cache, disallowing any package downloads. Alternatively, when the \fB\-\-cacheonly\fP
157 parameter is employed, it automatically sets the configuration option to \fBall\fP, resulting
158 in a fully cache\-driven operation.
159 .sp
160 Using the \fBmetadata\fP value for the \fBcacheonly\fP configuration can be advantageous when optional
161 repositories are temporarily unavailable or when we know they are unnecessary for our current
162 use case. It is also useful when cached metadata is not the latest or has expired but is still
163 functional.
164 .SH DELETE, CREATE, UPDATE
165 .sp
166 The following commands are used for manual cache deletion and creation:
167 .INDENT 0.0
168 .INDENT 3.5
169 .nf
170 \fBdnf5\-clean(8)\fP, \fI\%Clean command\fP
171 \fBdnf5\-makecache(8)\fP, \fI\%Makecache command\fP
172 .fi
173 .sp
174 .UNINDENT
175 .UNINDENT
176 .sp
177 To force metadata update before executing a command, use the \fB\-\-refresh\fP parameter.
178 .SH AUTHOR
179 See AUTHORS.md in dnf5 source distribution.
180 .SH COPYRIGHT
181 Contributors to the dnf5 project.
182 .\" Generated by docutils manpage writer.
183 .