1opam-clean(1)                     Opam Manual                    opam-clean(1)
2
3
4

NAME

6       opam-clean - Cleans up opam caches
7

SYNOPSIS

9       opam clean [OPTION]...
10

DESCRIPTION

12       Cleans up opam caches, reclaiming some disk space. If no options are
13       specified, the default is --logs --download-cache --switch-cleanup.
14

OPTIONS

16       -a, --all-switches
17           Run the switch cleanup commands in all switches. Implies
18           --switch-cleanup
19
20       -c, --download-cache
21           Clear the cache of downloaded files ($OPAMROOT/download-cache), as
22           well as the obsolete $OPAMROOT/archives, if that exists.
23
24       --dry-run
25           Print the removal commands, but don't execute them
26
27       --logs
28           Clear the logs directory.
29
30       -r, --repo-cache
31           Clear the repository cache. It will be rebuilt by the next opam
32           command that needs it.
33
34       -s, --switch-cleanup
35           Run the switch-specific cleanup: clears backups, build dirs,
36           uncompressed package sources of non-dev packages, local metadata of
37           previously pinned packages, etc.
38
39       --unused-repositories
40           Clear any configured repository that is not used by any switch nor
41           the default.
42

COMMON OPTIONS

44       These options are common to all commands.
45
46       --best-effort
47           Don't fail if all requested packages can't be installed: try to
48           install as many as possible. Note that not all external solvers may
49           support this option (recent versions of aspcud or mccs should).
50
51       --color=WHEN
52           Colorize the output. WHEN must be one of `always', `never' or
53           `auto'.
54
55       --criteria=CRITERIA
56           Specify user preferences for dependency solving for this run.
57           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
58           on the supported language, and the external solvers available, see
59           http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A
60           general guide to using solver preferences can be found at
61           http://www.dicosmo.org/Articles/usercriteria.pdf.
62
63       --cudf=FILENAME
64           Debug option: Save the CUDF requests sent to the solver to
65           FILENAME-<n>.cudf.
66
67       --debug
68           Print debug message to stderr. This is equivalent to setting
69           $OPAMDEBUG to "true".
70
71       --debug-level=LEVEL
72           Like --debug, but allows specifying the debug level (--debug sets
73           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
74
75       --git-version
76           Print the git version of opam, if set (i.e. you are using a
77           development version), and exit.
78
79       --help[=FMT] (default=auto)
80           Show this help in format FMT. The value FMT must be one of `auto',
81           `pager', `groff' or `plain'. With `auto', the format is `pager` or
82           `plain' whenever the TERM env var is `dumb' or undefined.
83
84       --ignore-pin-depends
85           Ignore extra pins required by packages that get pinned, either
86           manually through opam pin or through opam install DIR. This is
87           equivalent to setting IGNOREPINDEPENDS=true.
88
89       --json=FILENAME
90           Save the results of the opam run in a computer-readable file. If
91           the filename contains the character `%', it will be replaced by an
92           index that doesn't overwrite an existing file. Similar to setting
93           the $OPAMJSON variable.
94
95       --no-auto-upgrade
96           When configuring or updating a repository that is written for an
97           earlier opam version (1.2), opam internally converts it to the
98           current format. This disables this behaviour. Note that
99           repositories should define their format version in a 'repo' file at
100           their root, or they will be assumed to be in the older format. It
101           is, in any case, preferable to upgrade the repositories manually
102           using opam admin upgrade [--mirror URL] when possible.
103
104       --no-self-upgrade
105           Opam will replace itself with a newer binary found at OPAMROOT/opam
106           if present. This disables this behaviour.
107
108       -q, --quiet
109           Disables --verbose.
110
111       --root=ROOT
112           Use ROOT as the current root path. This is equivalent to setting
113           $OPAMROOT to ROOT.
114
115       --safe, --readonly
116           Make sure nothing will be automatically updated or rewritten.
117           Useful for calling from completion scripts, for example. Will fail
118           whenever such an operation is needed ; also avoids waiting for
119           locks, skips interactive questions and overrides the $OPAMDEBUG
120           variable.
121
122       --solver=CMD
123           Specify the CUDF solver to use for resolving package installation
124           problems. This is either a predefined solver (this version of opam
125           supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
126           aspcud-old, packup), or a custom command that should contain the
127           variables %{input}%, %{output}%, %{criteria}%, and optionally
128           %{timeout}%.
129
130       --strict
131           Fail whenever an error is found in a package definition or a
132           configuration file. The default is to continue silently if
133           possible.
134
135       --switch=SWITCH
136           Use SWITCH as the current compiler switch. This is equivalent to
137           setting $OPAMSWITCH to SWITCH.
138
139       --use-internal-solver, --no-aspcud
140           Disable any external solver, and use the built-in one (this
141           requires that opam has been compiled with a built-in solver).
142
143       -v, --verbose
144           Be more verbose. One -v shows all package commands, repeat to also
145           display commands called internally (e.g. tar, curl, patch etc.)
146           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
147
148       --version
149           Show version information.
150
151       -w, --working-dir
152           Whenever updating packages that are bound to a local,
153           version-controlled directory, update to the current working state
154           of their source instead of the last committed state, or the ref
155           they are pointing to. This only affects packages explicitly listed
156           on the command-line.
157
158       -y, --yes
159           Answer yes to all yes/no questions without prompting. This is
160           equivalent to setting $OPAMYES to "true".
161

ENVIRONMENT VARIABLES

163       Opam makes use of the environment variables listed here. Boolean
164       variables should be set to "0", "no", "false" or the empty string to
165       disable, "1", "yes" or "true" to enable.
166
167       OPAMCOLOR, when set to always or never, sets a default value for the
168       --color option.
169
170       OPAMCRITERIA specifies user preferences for dependency solving. The
171       default value depends on the solver version, use `config report` to
172       know the current setting. See also option --criteria
173
174       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
175       for more options.
176
177       OPAMDEBUG see options `--debug' and `--debug-level'.
178
179       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
180
181       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
182       fails. 0 to print all.
183
184       OPAMEXTERNALSOLVER see option `--solver'.
185
186       OPAMFETCH specifies how to download files: either `wget', `curl' or a
187       custom command where variables %{url}%, %{out}%, %{retry}%,
188       %{compress}% and %{checksum}% will be replaced. Overrides the
189       'download-command' value from the main config file.
190
191       OPAMJOBS sets the maximum number of parallel workers to run.
192
193       OPAMJSON log json output to the given file (use character `%' to index
194       the files)
195
196       OPAMLOCK see option `--lock'.
197
198       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
199       in an earlier format to the current one, on 'update' or 'init'.
200
201       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
202       some backups. This skips some finalisers and may also help to get more
203       reliable backtraces
204
205       OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
206       acquiring its lock and fails. <= 0 means infinite wait.
207
208       OPAMNO answer no to any question asked.
209
210       OPAMNOASPCUD see option `--no-aspcud'.
211
212       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
213
214       OPAMPINKINDAUTO sets whether version control systems should be detected
215       when pinning to a local path. Enabled by default since 1.3.0.
216
217       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
218       available (e.g. for `opam install`).
219
220       OPAMRETRY sets the number of tries before failing downloads.
221
222       OPAMROOT see option `--root'. This is automatically set by `opam env
223       --root=DIR --set-root'.
224
225       OPAMROOTISOK don't complain when running as root.
226
227       OPAMSAFE see option `--safe'
228
229       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
230       compatibility testing only.
231
232       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
233       60.0, set to 0 for unlimited. Note that all solvers may not support
234       this option.
235
236       OPAMSTATUSLINE display a dynamic status line showing what's currently
237       going on on the terminal. (one of one of `always', `never' or `auto')
238
239       OPAMSWITCH see option `--switch'. Automatically set by `opam env
240       --switch=SWITCH --set-switch'.
241
242       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
243       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
244       are set. See also option --criteria
245
246       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
247
248       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
249       or `auto'). By default `auto', which is determined from the locale).
250
251       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
252       Implies OPAMUTF8. This is set by default on OSX only.
253
254       OPAMVAR_var overrides the contents of the variable var when
255       substituting `%{var}%` strings in `opam` files.
256
257       OPAMVAR_package_var overrides the contents of the variable package:var
258       when substituting `%{package:var}%` strings in `opam` files.
259
260       OPAMVERBOSE see option `--verbose'.
261
262       OPAMYES see option `--yes'.
263

EXIT STATUS

265       As an exception to the following, the `exec' command returns 127 if the
266       command was not found or couldn't be executed, and the command's exit
267       value otherwise.
268
269       0   Success, or true for boolean queries.
270
271       1   False. Returned when a boolean return value is expected, e.g. when
272           running with --check, or for queries like opam lint.
273
274       2   Bad command-line arguments, or command-line arguments pointing to
275           an invalid context (e.g. file not following the expected format).
276
277       5   Not found. You requested something (package, version, repository,
278           etc.) that couldn't be found.
279
280       10  Aborted. The operation required confirmation, which wasn't given.
281
282       15  Could not acquire the locks required for the operation.
283
284       20  There is no solution to the user request. This can be caused by
285           asking to install two incompatible packages, for example.
286
287       30  Error in package definition, or other metadata files. Using
288           --strict raises this error more often.
289
290       31  Package script error. Some package operations were unsuccessful.
291           This may be an error in the packages or an incompatibility with
292           your system. This can be a partial error.
293
294       40  Sync error. Could not fetch some remotes from the network. This can
295           be a partial error.
296
297       50  Configuration error. Opam or system configuration doesn't allow
298           operation, and needs fixing.
299
300       60  Solver failure. The solver failed to return a sound answer. It can
301           be due to a broken external solver, or an error in solver
302           configuration.
303
304       99  Internal error. Something went wrong, likely due to a bug in opam
305           itself.
306
307       130 User interrupt. SIGINT was received, generally due to the user
308           pressing Ctrl-C.
309

FURTHER DOCUMENTATION

311       See https://opam.ocaml.org/doc.
312

AUTHORS

314       Vincent Bernardoff <vb@luminar.eu.org>
315       Raja Boujbel <raja.boujbel@ocamlpro.com>
316       Roberto Di Cosmo <roberto@dicosmo.org>
317       Thomas Gazagnaire <thomas@gazagnaire.org>
318       Louis Gesbert <louis.gesbert@ocamlpro.com>
319       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
320       Anil Madhavapeddy <anil@recoil.org>
321       Guillem Rieu <guillem.rieu@ocamlpro.com>
322       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
323       Frederic Tuong <tuong@users.gforge.inria.fr>
324

BUGS

326       Check bug reports at https://github.com/ocaml/opam/issues.
327
328
329
330Opam 2.0.1                                                       opam-clean(1)
Impressum