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

ENVIRONMENT VARIABLES

168       Opam makes use of the environment variables listed here. Boolean
169       variables should be set to "0", "no", "false" or the empty string to
170       disable, "1", "yes" or "true" to enable.
171
172       OPAMALLPARENS surround all filters with parenthesis
173
174       OPAMAUTOREMOVE see remove option `--auto-remove`
175
176       OPAMBESTEFFORT see option `--best-effort`
177
178       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
179       the criteria when the `--best-effort` option is set, and is expected to
180       maximise the `opam-query` property in the solution
181
182       OPAMCOLOR, when set to always or never, sets a default value for the
183       --color option.
184
185       OPAMCRITERIA specifies user preferences for dependency solving. The
186       default value depends on the solver version, use `config report` to
187       know the current setting. See also option --criteria
188
189       OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
190
191       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
192       for more options.
193
194       OPAMDEBUG see options `--debug' and `--debug-level'.
195
196       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
197
198       OPAMDRYRUN see option `--dry-run`
199
200       OPAMEDITOR sets the editor to use for opam file editing, overrides
201       $EDITOR and $VISUAL
202
203       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
204       fails. 0 to print all.
205
206       OPAMEXTERNALSOLVER see option `--solver'.
207
208       OPAMFAKE see option `--fake`
209
210       OPAMFETCH specifies how to download files: either `wget', `curl' or a
211       custom command where variables %{url}%, %{out}%, %{retry}%,
212       %{compress}% and %{checksum}% will be replaced. Overrides the
213       'download-command' value from the main config file.
214
215       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
216
217       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
218
219       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
220
221       OPAMJOBS sets the maximum number of parallel workers to run.
222
223       OPAMJSON log json output to the given file (use character `%' to index
224       the files)
225
226       OPAMLOCKED see install option `--locked`
227
228       OPAMLOGS logdir sets log directory, default is a temporary directory in
229       /tmp
230
231       OPAMMAKECMD set the system make command to use
232
233       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
234       in an earlier format to the current one, on 'update' or 'init'.
235
236       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
237       some backups. This skips some finalisers and may also help to get more
238       reliable backtraces
239
240       OPAMLOCKRETRIES sets the number of tries after which opam gives up
241       acquiring its lock and fails. <= 0 means infinite wait.
242
243       OPAMMERGEOUT merge process outputs, stderr on stdout
244
245       OPAMNO answer no to any question asked.
246
247       OPAMNOASPCUD Deprecated.
248
249       OPAMNOCHECKSUMS enables option --no-checksums when available.
250
251       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
252
253       OPAMPINKINDAUTO sets whether version control systems should be detected
254       when pinning to a local path. Enabled by default since 1.3.0.
255
256       OPAMPRECISETRACKING fine grain tracking of directories
257
258       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
259       available (e.g. for `opam install`).
260
261       OPAMRETRES sets the number of tries before failing downloads.
262
263       OPAMROOT see option `--root'. This is automatically set by `opam env
264       --root=DIR --set-root'.
265
266       OPAMROOTISOK don't complain when running as root.
267
268       OPAMSAFE see option `--safe'
269
270       OPAMSHOW see option `--show`
271
272       OPAMSKIPUPDATE see option `--skip-updates`
273
274       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
275       compatibility testing only.
276
277       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
278       60.0, set to 0 for unlimited. Note that all solvers may not support
279       this option.
280
281       OPAMSTATUSLINE display a dynamic status line showing what's currently
282       going on on the terminal. (one of one of `always', `never' or `auto')
283
284       OPAMSTATS display stats at the end of command
285
286       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
287
288       OPAMSWITCH see option `--switch'. Automatically set by `opam env
289       --switch=SWITCH --set-switch'.
290
291       OPAMUNLOCKBASE see install option `--unlock-base`
292
293       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
294       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
295       are set. See also option --criteria
296
297       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
298
299       OPAMUSEOPENSSL force openssl use for hash computing
300
301       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
302       or `auto'). By default `auto', which is determined from the locale).
303
304       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
305       Implies OPAMUTF8. This is set by default on OSX only.
306
307       OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
308       an opam repository update
309
310       OPAMVAR_var overrides the contents of the variable var when
311       substituting `%{var}%` strings in `opam` files.
312
313       OPAMVAR_package_var overrides the contents of the variable package:var
314       when substituting `%{package:var}%` strings in `opam` files.
315
316       OPAMVERBOSE see option `--verbose'.
317
318       OPAMWORKINGDIR see option `--working-dir`
319
320       OPAMYES see option `--yes'.
321

EXIT STATUS

323       As an exception to the following, the `exec' command returns 127 if the
324       command was not found or couldn't be executed, and the command's exit
325       value otherwise.
326
327       0   Success, or true for boolean queries.
328
329       1   False. Returned when a boolean return value is expected, e.g. when
330           running with --check, or for queries like opam lint.
331
332       2   Bad command-line arguments, or command-line arguments pointing to
333           an invalid context (e.g. file not following the expected format).
334
335       5   Not found. You requested something (package, version, repository,
336           etc.) that couldn't be found.
337
338       10  Aborted. The operation required confirmation, which wasn't given.
339
340       15  Could not acquire the locks required for the operation.
341
342       20  There is no solution to the user request. This can be caused by
343           asking to install two incompatible packages, for example.
344
345       30  Error in package definition, or other metadata files. Using
346           --strict raises this error more often.
347
348       31  Package script error. Some package operations were unsuccessful.
349           This may be an error in the packages or an incompatibility with
350           your system. This can be a partial error.
351
352       40  Sync error. Could not fetch some remotes from the network. This can
353           be a partial error.
354
355       50  Configuration error. Opam or system configuration doesn't allow
356           operation, and needs fixing.
357
358       60  Solver failure. The solver failed to return a sound answer. It can
359           be due to a broken external solver, or an error in solver
360           configuration.
361
362       99  Internal error. Something went wrong, likely due to a bug in opam
363           itself.
364
365       130 User interrupt. SIGINT was received, generally due to the user
366           pressing Ctrl-C.
367

FURTHER DOCUMENTATION

369       See https://opam.ocaml.org/doc.
370

AUTHORS

372       Vincent Bernardoff <vb@luminar.eu.org>
373       Raja Boujbel <raja.boujbel@ocamlpro.com>
374       Roberto Di Cosmo <roberto@dicosmo.org>
375       Thomas Gazagnaire <thomas@gazagnaire.org>
376       Louis Gesbert <louis.gesbert@ocamlpro.com>
377       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
378       Anil Madhavapeddy <anil@recoil.org>
379       Guillem Rieu <guillem.rieu@ocamlpro.com>
380       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
381       Frederic Tuong <tuong@users.gforge.inria.fr>
382

BUGS

384       Check bug reports at https://github.com/ocaml/opam/issues.
385
386
387
388Opam 2.0.6                                                       OPAM-CLEAN(1)
Impressum