1OPAM-VAR(1)                       Opam Manual                      OPAM-VAR(1)
2
3
4

NAME

6       opam-var - Display and update the value associated with a given
7       variable
8

SYNOPSIS

10       opam var [OPTION]... [VAR[=[VALUE]]]
11

DESCRIPTION

13       Without argument, lists the opam variables currently defined. With a
14       VAR argument, prints the value associated with VAR. Otherwise, sets or
15       updates VAR's value. If no scope is given, it acts on switch variables
16       by default. This command does not perform any variable expansion.
17

ARGUMENTS

19       VAR[=[VALUE]]
20           If only VAR is given, displays its associated value. If VALUE is
21           absent, VAR's value is removed. Otherwise, its value is
22           overwritten.
23

OPTIONS

25       --global
26           Act on global configuration
27
28       --no
29           Answer no to all opam yes/no questions without prompting. See also
30           --confirm-level. This is equivalent to setting $OPAMNO to "true".
31
32       --package=PACKAGE
33           List all variables defined for the given package
34
35       -y, --yes
36           Answer yes to all opam yes/no questions without prompting. See also
37           --confirm-level. This is equivalent to setting $OPAMYES to "true".
38

COMMON OPTIONS

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

ENVIRONMENT

177       Opam makes use of the environment variables listed here. Boolean
178       variables should be set to "0", "no", "false" or the empty string to
179       disable, "1", "yes" or "true" to enable.
180
181       OPAMALLPARENS surround all filters with parenthesis.
182
183       OPAMASSUMEDEPEXTS see option `--assume-depexts'.
184
185       OPAMAUTOREMOVE see remove option `--auto-remove'.
186
187       OPAMBESTEFFORT see option `--best-effort'.
188
189       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
190       the criteria when the `--best-effort' option is set, and is expected to
191       maximise the `opam-query' property in the solution.
192
193       OPAMBUILDDOC Removed in 2.1.
194
195       OPAMBUILDTEST Removed in 2.1.
196
197       OPAMCLI see option `--cli'.
198
199       OPAMCOLOR when set to always or never, sets a default value for the
200       `--color' option.
201
202       OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
203       priority over OPAMYES and OPAMNO.
204
205       OPAMCRITERIA specifies user preferences for dependency solving. The
206       default value depends on the solver version, use `config report' to
207       know the current setting. See also option --criteria.
208
209       OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
210
211       OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
212       preprocessing.
213
214       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
215       for more options.
216
217       OPAMDEBUG see options `--debug' and `--debug-level'.
218
219       OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
220       list of sections. Sections can optionally have a specific debug level
221       (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
222       `--debug-level'.
223
224       OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
225       CUDF preprocessing is.
226
227       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
228
229       OPAMDROPWORKINGDIR overrides packages previously updated with
230       --working-dir on update. Without this variable set, opam would keep
231       them unchanged unless explicitly named on the command-line.
232
233       OPAMDRYRUN see option `--dry-run'.
234
235       OPAMEDITOR sets the editor to use for opam file editing, overrides
236       $EDITOR and $VISUAL.
237
238       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
239       fails. 0 to print all.
240
241       OPAMEXTERNALSOLVER see option `--solver'.
242
243       OPAMFAKE see option `--fake'.
244
245       OPAMFETCH specifies how to download files: either `wget', `curl' or a
246       custom command where variables %{url}%, %{out}%, %{retry}%,
247       %{compress}% and %{checksum}% will be replaced. Overrides the
248       'download-command' value from the main config file.
249
250       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
251
252       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
253
254       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
255
256       OPAMINPLACEBUILD see option `--inplace-build'.
257
258       OPAMJOBS sets the maximum number of parallel workers to run.
259
260       OPAMJSON log json output to the given file (use character `%' to index
261       the files).
262
263       OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
264
265       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
266       some backups. This skips some finalisers and may also help to get more
267       reliable backtraces.
268
269       OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
270
271       OPAMLOGS logdir sets log directory, default is a temporary directory in
272       /tmp
273
274       OPAMMAKECMD set the system make command to use.
275
276       OPAMMERGEOUT merge process outputs, stderr on stdout.
277
278       OPAMNO answer no to any question asked, see options `--no` and
279       `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
280       OPAMYES is set.
281
282       OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
283
284       OPAMNOASPCUD Deprecated.
285
286       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
287       in an earlier format to the current one, on 'update' or 'init'.
288
289       OPAMNOCHECKSUMS enables option --no-checksums when available.
290
291       OPAMNODEPEXTS disables system dependencies handling, see option
292       `--no-depexts'.
293
294       OPAMNOENVNOTICE Internal.
295
296       OPAMNOSELFUPGRADE see option `--no-self-upgrade'
297
298       OPAMPINKINDAUTO sets whether version control systems should be detected
299       when pinning to a local path. Enabled by default since 1.3.0.
300
301       OPAMPRECISETRACKING fine grain tracking of directories.
302
303       OPAMPREPRO set this to false to disable CUDF preprocessing. Less
304       efficient, but might help debugging solver issue.
305
306       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
307       available (e.g. for `opam install').
308
309       OPAMRETRIES sets the number of tries before failing downloads.
310
311       OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
312
313       OPAMROOT see option `--root'. This is automatically set by `opam env
314       --root=DIR --set-root'.
315
316       OPAMROOTISOK don't complain when running as root.
317
318       OPAMSAFE see option `--safe'.
319
320       OPAMSHOW see option `--show'.
321
322       OPAMSKIPUPDATE see option `--skip-updates'.
323
324       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
325       compatibility testing only.
326
327       OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
328       return a solution when they reach timeout; while the solution remains
329       assured to be consistent, there is no guarantee in this case that it
330       fits the expected optimisation criteria. If `true', opam willcontinue
331       with a warning, if `false' a timeout is an error. Currently only the
332       builtin-z3 backend handles this degraded case.
333
334       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
335       60.0, set to 0 for unlimited. Note that all solvers may not support
336       this option.
337
338       OPAMSTATS display stats at the end of command.
339
340       OPAMSTATUSLINE display a dynamic status line showing what's currently
341       going on on the terminal. (one of one of `always', `never' or `auto')
342
343       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
344
345       OPAMSWITCH see option `--switch'. Automatically set by `opam env
346       --switch=SWITCH --set-switch'.
347
348       OPAMUNLOCKBASE see install option `--unlock-base'.
349
350       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
351       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
352       are set. See also option --criteria.
353
354       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
355
356       OPAMUSEOPENSSL force openssl use for hash computing.
357
358       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
359       or `auto'). By default `auto', which is determined from the locale).
360
361       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
362       Implies OPAMUTF8. This is set by default on OSX only.
363
364       OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
365       opam repository update.
366
367       OPAMVERBOSE see option `--verbose'.
368
369       OPAMVERSIONLAGPOWER do not use.
370
371       OPAMWITHDOC see install option `--with-doc'.
372
373       OPAMWITHTEST see install option `--with-test.
374
375       OPAMWORKINGDIR see option `--working-dir'.
376
377       OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
378       priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
379
380       OPAMVAR_var overrides the contents of the variable var when
381       substituting `%{var}%` strings in `opam` files.
382
383       OPAMVAR_package_var overrides the contents of the variable package:var
384       when substituting `%{package:var}%` strings in `opam` files.
385

CLI VERSION

387       All scripts and programmatic invocations of opam should use `--cli' in
388       order to ensure that they work seamlessly with future versions of the
389       opam client. Additionally, blog posts or other documentation can
390       benefit, as it prevents information from becoming stale.
391
392       Although opam only supports roots (~/.opam/) for the current version,
393       it does provide backwards compatibility for its command-line interface.
394
395       Since CLI version support was only added in opam 2.1, use OPAMCLI to
396       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
397       for 2.1 (or later) versions, since an environment variable controlling
398       the parsing of syntax is brittle. To this end, opam displays a warning
399       if OPAMCLI specifies a valid version other than 2.0, and also if
400       `--cli=2.0' is specified.
401
402       The command-line version is selected by using the `--cli' option or the
403       OPAMCLI environment variable. `--cli' may be specified morethan once,
404       where the last instance takes precedence. OPAMCLI is only inspected if
405       `--cli' is not given.
406

EXIT STATUS

408       As an exception to the following, the `exec' command returns 127 if the
409       command was not found or couldn't be executed, and the command's exit
410       value otherwise.
411
412       0   Success, or true for boolean queries.
413
414       1   False. Returned when a boolean return value is expected, e.g. when
415           running with --check, or for queries like opam lint.
416
417       2   Bad command-line arguments, or command-line arguments pointing to
418           an invalid context (e.g. file not following the expected format).
419
420       5   Not found. You requested something (package, version, repository,
421           etc.) that couldn't be found.
422
423       10  Aborted. The operation required confirmation, which wasn't given.
424
425       15  Could not acquire the locks required for the operation.
426
427       20  There is no solution to the user request. This can be caused by
428           asking to install two incompatible packages, for example.
429
430       30  Error in package definition, or other metadata files. Using
431           --strict raises this error more often.
432
433       31  Package script error. Some package operations were unsuccessful.
434           This may be an error in the packages or an incompatibility with
435           your system. This can be a partial error.
436
437       40  Sync error. Could not fetch some remotes from the network. This can
438           be a partial error.
439
440       50  Configuration error. Opam or system configuration doesn't allow
441           operation, and needs fixing.
442
443       60  Solver failure. The solver failed to return a sound answer. It can
444           be due to a broken external solver, or an error in solver
445           configuration.
446
447       99  Internal error. Something went wrong, likely due to a bug in opam
448           itself.
449
450       130 User interrupt. SIGINT was received, generally due to the user
451           pressing Ctrl-C.
452

FURTHER DOCUMENTATION

454       See https://opam.ocaml.org/doc.
455

AUTHORS

457       Vincent Bernardoff <vb@luminar.eu.org>
458       Raja Boujbel <raja.boujbel@ocamlpro.com>
459       Roberto Di Cosmo <roberto@dicosmo.org>
460       Thomas Gazagnaire <thomas@gazagnaire.org>
461       Louis Gesbert <louis.gesbert@ocamlpro.com>
462       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
463       Anil Madhavapeddy <anil@recoil.org>
464       Guillem Rieu <guillem.rieu@ocamlpro.com>
465       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
466       Frederic Tuong <tuong@users.gforge.inria.fr>
467

BUGS

469       Check bug reports at https://github.com/ocaml/opam/issues.
470
471
472
473Opam 2.1.2                                                         OPAM-VAR(1)
Impressum