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

NAME

6       opam-switch - Manage multiple installation prefixes.
7

SYNOPSIS

9       opam switch [OPTION]… [COMMAND] [ARG]…
10

DESCRIPTION

12       This command is used to manage "switches", which are independent
13       installation prefixes with their own compiler and sets of installed and
14       pinned packages. This is typically useful to have different versions of
15       the compiler available at once.
16
17       Use opam switch create to create a new switch, and opam switch set to
18       set the currently active switch. Without argument, lists installed
19       switches, with one switch argument, defaults to set.
20
21       Switch handles SWITCH can be either a plain name, for switches that
22       will be held inside ~/.opam, or a directory name, which in that case is
23       the directory where the switch prefix will be installed, as _opam. Opam
24       will automatically select a switch by that name found in the current
25       directory or its parents, unless OPAMSWITCH is set or --switch is
26       specified. When creating a directory switch, if package definitions are
27       found locally, the user is automatically prompted to install them after
28       the switch is created unless --no-install is specified.
29
30       opam switch set sets the default switch globally, but it is also
31       possible to select a switch in a given shell session, using the
32       environment. For that, use eval $(opam env --switch=SWITCH
33       --set-switch).
34

COMMANDS

36       Without argument, defaults to list.
37
38       SWITCH
39           With a SWITCH argument, defaults to set SWITCH.
40
41       create SWITCH [COMPILER]
42           Create a new switch, and install the given compiler there. SWITCH
43           can be a plain name, or a directory, absolute or relative, in which
44           case a local switch is created below the given directory. COMPILER,
45           if omitted, defaults to SWITCH if it is a plain name, unless
46           --packages, --formula or --empty is specified. When creating a
47           local switch, and none of these options are present, the compiler
48           is chosen according to the configuration default (see
49           opam-init(1)). If the chosen directory contains package
50           definitions, a compatible compiler is searched within the default
51           selection, and the packages will automatically get installed.
52
53       set SWITCH
54           Set the currently active switch, among the installed switches.
55
56       remove SWITCH
57           Remove the given switch from disk.
58
59       export FILE
60           Save the current switch state to a file. If --full is specified, it
61           includes the metadata of all installed packages, and if --freeze is
62           specified, it freezes all vcs to their current commit.
63
64       import FILE
65           Import a saved switch state. If --switch is specified and doesn't
66           point to an existing switch, the switch will be created for the
67           import.
68
69       reinstall [SWITCH]
70           Reinstall the given compiler switch and all its packages.
71
72       list
73           Lists installed switches.
74
75       list-available [PATTERN]
76           Lists all the possible packages that are advised for installation
77           when creating a new switch, i.e. packages with the compiler flag
78           set. If no pattern is supplied, all versions are shown.
79
80       show
81           Prints the name of the current switch.
82
83       invariant
84           Prints the active switch invariant.
85
86       set-invariant PACKAGES
87           Updates the switch invariant, that is, the formula that the switch
88           must keep verifying throughout all operations. The previous setting
89           is overriden. See also options --force and --no-action. Without
90           arguments, an invariant is chosen automatically.
91
92       set-description STRING
93           Sets the description for the selected switch.
94
95       link SWITCH [DIR]
96           Sets a local alias for a given switch, so that the switch gets
97           automatically selected whenever in that directory or a descendant.
98
99       install SWITCH
100           Removed in 2.1, use create instead.
101
102       set-base PACKAGES
103           Removed in 2.1, use set-invariant instead.
104

EXAMPLES

106           opam switch create 4.08.0
107
108       Create a new switch called "4.08.0" and select it, with a compiler
109       automatically selected at version 4.08.0 (note that this can fail in
110       case there is more than one compiler matching that version).
111
112           opam switch create ./ --deps-only
113
114       Prepare a local switch for building the packages defined in ./. This
115       scans the current directory for package definitions, chooses a
116       compatible compiler, creates a local switch and installs the local
117       package dependencies.
118
119           opam switch create trunk --repos default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git ocaml-variants.4.10.0+trunk
120
121       Create a new switch called "trunk", with ocaml-variants.4.10.0+trunk as
122       compiler, with a new beta repository bound to the given URL selected
123       besides the default one.
124

OPTIONS

126       -A COMP, --alias-of=COMP
127           Removed in 2.1.
128
129       --deps-only
130           When creating a local switch in a project directory (i.e. a
131           directory containing opam package definitions), install the
132           dependencies of the project but not the project itself.
133
134       --description=STRING
135           Attach the given description to a switch when creating it. Use the
136           set-description subcommand to modify the description of an existing
137           switch.
138
139       --empty
140           Allow creating an empty switch, with no invariant.
141
142       --force
143           Only for set-invariant: force setting the invariant, bypassing
144           consistency checks.
145
146       --formula=FORMULA
147           Allows specifying a complete "dependency formula", possibly
148           including disjunction cases, as the switch invariant.
149
150       --freeze
151           When exporting, locks all VCS urls to their current commit, failing
152           if it can not be retrieved. This ensures that an import will
153           restore the exact state. Implies --full.
154
155       --full
156           When exporting, include the metadata of all installed packages,
157           allowing to re-import even if they don't exist in the repositories
158           (the default is to include only the metadata of pinned packages).
159
160       -j JOBS, --jobs=JOBS
161           Set the maximal number of concurrent jobs to use. The default value
162           is calculated from the number of cores. You can also set it using
163           the $OPAMJOBS environment variable.
164
165       -n, --no-action
166           Only for set-invariant: set the invariant, but don't enforce it
167           right away: wait for the next install, upgrade or similar command.
168
169       --no
170           Answer no to all opam yes/no questions without prompting. See also
171           --confirm-level. This is equivalent to setting $OPAMNO to "true".
172
173       --no-autoinstall
174           Removed in 2.1.
175
176       --no-install
177           When creating a local switch, don't look for any local package
178           definitions to install.
179
180       --no-switch
181           Don't automatically select newly installed switches.
182
183       --packages=PACKAGES
184           When installing a switch, explicitly define the set of packages to
185           enforce as the switch invariant.
186
187       --repositories=REPOS
188           When creating a new switch, use the given selection of repositories
189           instead of the default. REPOS should be a comma-separated list of
190           either already registered repository names (configured through e.g.
191           opam repository add --dont-select), or NAME=URL bindings, in which
192           case NAME should not be registered already to a different URL, and
193           the new repository will be registered. See opam repository for more
194           details. This option also affects list-available.
195
196       -s, --short
197           Output raw lists of names, one per line, skipping any details.
198
199       -y, --yes
200           Answer yes to all opam yes/no questions without prompting. See also
201           --confirm-level. This is equivalent to setting $OPAMYES to "true".
202

PACKAGE BUILD OPTIONS

204       --assume-depexts
205           Skip the installation step for any missing system packages, and
206           attempt to proceed with compilation of the opam packages anyway. If
207           the installation is successful, opam won't prompt again about these
208           system packages. Only meaningful if external dependency handling is
209           enabled.
210
211       -b, --keep-build-dir
212           Keep the build directories after compiling packages. This is
213           equivalent to setting $OPAMKEEPBUILDDIR to "true".
214
215       --build-doc
216           Removed in 2.1, use --with-doc instead.
217
218       --build-test
219           Removed in 2.1, use --with-test instead.
220
221       -d, --with-doc
222           Build the package documentation. This only affects packages listed
223           on the command-line. This is equivalent to setting $OPAMWITHDOC (or
224           the deprecated $OPAMBUILDDOC) to "true".
225
226       --dry-run
227           Simulate the command, but don't actually perform any changes. This
228           also can be set with environment variable $OPAMDEBUG.
229
230       --fake
231           This option registers the actions into the opam database, without
232           actually performing them. WARNING: This option is dangerous and
233           likely to break your opam environment. You probably want --dry-run.
234           You've been warned.
235
236       --ignore-constraints-on[=PACKAGES] (default=)
237           Forces opam to ignore version constraints on all dependencies to
238           the listed packages. This can be used to test compatibility, but
239           expect builds to break when using this. Note that version
240           constraints on optional dependencies and conflicts are unaffected.
241           This is equivalent to setting $OPAMIGNORECONSTRAINTS.
242
243       --inplace-build
244           When compiling a package which has its source bound to a local
245           directory, process the build and install actions directly in that
246           directory, rather than in a clean copy handled by opam. This only
247           affects packages that are explicitly listed on the command-line.
248           This is equivalent to setting $OPAMINPLACEBUILD to "true".
249
250       --lock-suffix=SUFFIX (absent=locked)
251           Set locked files suffix to SUFFIX.
252
253       --locked
254           In commands that use opam files found from pinned sources, if a
255           variant of the file with an added .locked extension is found (e.g.
256           foo.opam.locked besides foo.opam), that will be used instead. This
257           is typically useful to offer a more specific set of dependencies
258           and reproduce similar build contexts, hence the name. The
259           lockoption can be used to generate such files, based on the
260           versions of the dependencies currently installed on the host. This
261           is equivalent to setting the $OPAMLOCKED environment variable. Note
262           that this option doesn't generally affect already pinned packages.
263
264       -m MAKE, --make=MAKE
265           Removed in 2.1, use opam config set[-global] make MAKE instead.
266
267       --no-checksums
268           Do not verify the checksum of downloaded archives.This is
269           equivalent to setting $OPAMNOCHECKSUMS to "true".
270
271       --no-depexts
272           Temporarily disables handling of external dependencies. This can be
273           used if a package is not available on your system package manager,
274           but you installed the required dependency by hand. Implies
275           --assume-depexts, and stores the exceptions upon success as well.
276
277       --require-checksums
278           Reject the installation of packages that don't provide a checksum
279           for the upstream archives. This is equivalent to setting
280           $OPAMREQUIRECHECKSUMS to "true".
281
282       --reuse-build-dir
283           Reuse existing build directories (kept by using --keep-build-dir),
284           instead of compiling from a fresh clone of the source. This can be
285           faster, but also lead to failures if the build systems of the
286           packages don't handle upgrades of dependencies well. This is
287           equivalent to setting $OPAMREUSEBUILDDIR to "true".
288
289       --show-actions
290           Call the solver and display the actions. Don't perform any changes.
291           This is equivalent to setting $OPAMSHOW.
292
293       --skip-updates
294           When running an install, upgrade or reinstall on source-pinned
295           packages, they are normally updated from their origin first. This
296           flag disables that behaviour and will keep them to their version in
297           cache. This is equivalent to setting $OPAMSKIPUPDATE.
298
299       -t, --with-test
300           Build and run the package unit-tests. This only affects packages
301           listed on the command-line. This is equivalent to setting
302           $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
303
304       --unlock-base
305           Removed in 2.1, use --update-invariant instead.
306
307       --update-invariant
308           Allow changes to the packages set as switch base (typically, the
309           main compiler). Use with caution. This is equivalent to setting the
310           $OPAMUNLOCKBASE environment variable
311

COMMON OPTIONS

313       These options are common to all commands.
314
315       --best-effort
316           Don't fail if all requested packages can't be installed: try to
317           install as many as possible. Note that not all external solvers may
318           support this option (recent versions of aspcud or mccs should).
319           This is equivalent to setting $OPAMBESTEFFORT environment variable.
320
321       --cli=MAJOR.MINOR (absent=2.1)
322           Use the command-line interface syntax and semantics of MAJOR.MINOR.
323           Intended for any persistent use of opam (scripts, blog posts,
324           etc.), any version of opam in the same MAJOR series will behave as
325           for the specified MINOR release. The flag was not available in opam
326           2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable
327           to 2.0 instead of using this parameter.
328
329       --color=WHEN
330           Colorize the output. WHEN must be one of always, never or auto.
331
332       --confirm-level=LEVEL
333           Confirmation level, LEVEL must be one of ask, no, yes or
334           unsafe-yes. Can be specified more than once. If --yes or --no are
335           also given, the value of the last --confirm-level is taken into
336           account. This is equivalent to setting  $OPAMCONFIRMLEVEL`.
337
338       --criteria=CRITERIA
339           Specify user preferences for dependency solving for this run.
340           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
341           on the supported language, and the external solvers available, see
342           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
343           using solver preferences can be found at
344           http://www.dicosmo.org/Articles/usercriteria.pdf.
345
346       --cudf=FILENAME
347           Debug option: Save the CUDF requests sent to the solver to
348           FILENAME-<n>.cudf.
349
350       --debug
351           Print debug message to stderr. This is equivalent to setting
352           $OPAMDEBUG to "true".
353
354       --debug-level=LEVEL
355           Like --debug, but allows specifying the debug level (--debug sets
356           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
357
358       --git-version
359           Print the git version of opam, if set (i.e. you are using a
360           development version), and exit.
361
362       --help[=FMT] (default=auto)
363           Show this help in format FMT. The value FMT must be one of auto,
364           pager, groff or plain. With auto, the format is pager or plain
365           whenever the TERM env var is dumb or undefined.
366
367       --ignore-pin-depends
368           Ignore extra pins required by packages that get pinned, either
369           manually through opam pin or through opam install DIR. This is
370           equivalent to setting IGNOREPINDEPENDS=true.
371
372       --json=FILENAME
373           Save the results of the opam run in a computer-readable file. If
374           the filename contains the character `%', it will be replaced by an
375           index that doesn't overwrite an existing file. Similar to setting
376           the $OPAMJSON variable.
377
378       --no-aspcud
379           Removed in 2.1.
380
381       --no-auto-upgrade
382           When configuring or updating a repository that is written for an
383           earlier opam version (1.2), opam internally converts it to the
384           current format. This disables this behaviour. Note that
385           repositories should define their format version in a 'repo' file at
386           their root, or they will be assumed to be in the older format. It
387           is, in any case, preferable to upgrade the repositories manually
388           using opam admin upgrade [--mirror URL] when possible.
389
390       --no-self-upgrade
391           Opam will replace itself with a newer binary found at OPAMROOT/opam
392           if present. This disables this behaviour.
393
394       -q, --quiet
395           Disables --verbose.
396
397       --root=ROOT
398           Use ROOT as the current root path. This is equivalent to setting
399           $OPAMROOT to ROOT.
400
401       --safe, --readonly
402           Make sure nothing will be automatically updated or rewritten.
403           Useful for calling from completion scripts, for example. Will fail
404           whenever such an operation is needed ; also avoids waiting for
405           locks, skips interactive questions and overrides the $OPAMDEBUG
406           variable. This is equivalent to set environment variable $OPAMSAFE.
407
408       --solver=CMD
409           Specify the CUDF solver to use for resolving package installation
410           problems. This is either a predefined solver (this version of opam
411           supports builtin-mccs+lp(), builtin-mccs+glpk,
412           builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
413           mccs, aspcud-old, packup), or a custom command that should contain
414           the variables %{input}%, %{output}%, %{criteria}%, and optionally
415           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
416
417       --strict
418           Fail whenever an error is found in a package definition or a
419           configuration file. The default is to continue silently if
420           possible.
421
422       --switch=SWITCH
423           Use SWITCH as the current compiler switch. This is equivalent to
424           setting $OPAMSWITCH to SWITCH.
425
426       --use-internal-solver
427           Disable any external solver, and use the built-in one (this
428           requires that opam has been compiled with a built-in solver). This
429           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
430
431       -v, --verbose
432           Be more verbose. One -v shows all package commands, repeat to also
433           display commands called internally (e.g. tar, curl, patch etc.)
434           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
435
436       --version
437           Show version information.
438
439       -w, --working-dir
440           Whenever updating packages that are bound to a local,
441           version-controlled directory, update to the current working state
442           of their source instead of the last committed state, or the ref
443           they are pointing to. As source directory is copied as it is, if it
444           isn't clean it may result on a opam build failure.This only affects
445           packages explicitly listed on the command-line.It can also be set
446           with $OPAMWORKINGDIR.
447

ENVIRONMENT

449       Opam makes use of the environment variables listed here. Boolean
450       variables should be set to "0", "no", "false" or the empty string to
451       disable, "1", "yes" or "true" to enable.
452
453       OPAMALLPARENS surround all filters with parenthesis.
454
455       OPAMASSUMEDEPEXTS see option `--assume-depexts'.
456
457       OPAMAUTOREMOVE see remove option `--auto-remove'.
458
459       OPAMBESTEFFORT see option `--best-effort'.
460
461       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
462       the criteria when the `--best-effort' option is set, and is expected to
463       maximise the `opam-query' property in the solution.
464
465       OPAMBUILDDOC Removed in 2.1.
466
467       OPAMBUILDTEST Removed in 2.1.
468
469       OPAMCLI see option `--cli'.
470
471       OPAMCOLOR when set to always or never, sets a default value for the
472       `--color' option.
473
474       OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
475       priority over OPAMYES and OPAMNO.
476
477       OPAMCRITERIA specifies user preferences for dependency solving. The
478       default value depends on the solver version, use `config report' to
479       know the current setting. See also option --criteria.
480
481       OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
482
483       OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
484       preprocessing.
485
486       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
487       for more options.
488
489       OPAMDEBUG see options `--debug' and `--debug-level'.
490
491       OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
492       list of sections. Sections can optionally have a specific debug level
493       (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
494       `--debug-level'.
495
496       OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
497       CUDF preprocessing is.
498
499       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
500
501       OPAMDROPWORKINGDIR overrides packages previously updated with
502       --working-dir on update. Without this variable set, opam would keep
503       them unchanged unless explicitly named on the command-line.
504
505       OPAMDRYRUN see option `--dry-run'.
506
507       OPAMEDITOR sets the editor to use for opam file editing, overrides
508       $EDITOR and $VISUAL.
509
510       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
511       fails. 0 to print all.
512
513       OPAMEXTERNALSOLVER see option `--solver'.
514
515       OPAMFAKE see option `--fake'.
516
517       OPAMFETCH specifies how to download files: either `wget', `curl' or a
518       custom command where variables %{url}%, %{out}%, %{retry}%,
519       %{compress}% and %{checksum}% will be replaced. Overrides the
520       'download-command' value from the main config file.
521
522       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
523
524       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
525
526       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
527
528       OPAMINPLACEBUILD see option `--inplace-build'.
529
530       OPAMJOBS sets the maximum number of parallel workers to run.
531
532       OPAMJSON log json output to the given file (use character `%' to index
533       the files).
534
535       OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
536
537       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
538       some backups. This skips some finalisers and may also help to get more
539       reliable backtraces.
540
541       OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
542
543       OPAMLOGS logdir sets log directory, default is a temporary directory in
544       /tmp
545
546       OPAMMAKECMD set the system make command to use.
547
548       OPAMMERGEOUT merge process outputs, stderr on stdout.
549
550       OPAMNO answer no to any question asked, see options `--no` and
551       `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
552       OPAMYES is set.
553
554       OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
555
556       OPAMNOASPCUD Deprecated.
557
558       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
559       in an earlier format to the current one, on 'update' or 'init'.
560
561       OPAMNOCHECKSUMS enables option --no-checksums when available.
562
563       OPAMNODEPEXTS disables system dependencies handling, see option
564       `--no-depexts'.
565
566       OPAMNOENVNOTICE Internal.
567
568       OPAMNOSELFUPGRADE see option `--no-self-upgrade'
569
570       OPAMPINKINDAUTO sets whether version control systems should be detected
571       when pinning to a local path. Enabled by default since 1.3.0.
572
573       OPAMPRECISETRACKING fine grain tracking of directories.
574
575       OPAMPREPRO set this to false to disable CUDF preprocessing. Less
576       efficient, but might help debugging solver issue.
577
578       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
579       available (e.g. for `opam install').
580
581       OPAMRETRIES sets the number of tries before failing downloads.
582
583       OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
584
585       OPAMROOT see option `--root'. This is automatically set by `opam env
586       --root=DIR --set-root'.
587
588       OPAMROOTISOK don't complain when running as root.
589
590       OPAMSAFE see option `--safe'.
591
592       OPAMSHOW see option `--show'.
593
594       OPAMSKIPUPDATE see option `--skip-updates'.
595
596       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
597       compatibility testing only.
598
599       OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
600       return a solution when they reach timeout; while the solution remains
601       assured to be consistent, there is no guarantee in this case that it
602       fits the expected optimisation criteria. If `true', opam willcontinue
603       with a warning, if `false' a timeout is an error. Currently only the
604       builtin-z3 backend handles this degraded case.
605
606       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
607       60.0, set to 0 for unlimited. Note that all solvers may not support
608       this option.
609
610       OPAMSTATS display stats at the end of command.
611
612       OPAMSTATUSLINE display a dynamic status line showing what's currently
613       going on on the terminal. (one of one of always, never or auto)
614
615       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
616
617       OPAMSWITCH see option `--switch'. Automatically set by `opam env
618       --switch=SWITCH --set-switch'.
619
620       OPAMUNLOCKBASE see install option `--unlock-base'.
621
622       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
623       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
624       are set. See also option --criteria.
625
626       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
627
628       OPAMUSEOPENSSL force openssl use for hash computing.
629
630       OPAMUTF8 use UTF8 characters in output (one of one of always, never or
631       auto). By default `auto', which is determined from the locale).
632
633       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
634       Implies OPAMUTF8. This is set by default on OSX only.
635
636       OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
637       opam repository update.
638
639       OPAMVERBOSE see option `--verbose'.
640
641       OPAMVERSIONLAGPOWER do not use.
642
643       OPAMWITHDOC see install option `--with-doc'.
644
645       OPAMWITHTEST see install option `--with-test.
646
647       OPAMWORKINGDIR see option `--working-dir'.
648
649       OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
650       priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
651
652       OPAMVAR_var overrides the contents of the variable var when
653       substituting `%{var}%` strings in `opam` files.
654
655       OPAMVAR_package_var overrides the contents of the variable package:var
656       when substituting `%{package:var}%` strings in `opam` files.
657

CLI VERSION

659       All scripts and programmatic invocations of opam should use `--cli' in
660       order to ensure that they work seamlessly with future versions of the
661       opam client. Additionally, blog posts or other documentation can
662       benefit, as it prevents information from becoming stale.
663
664       Although opam only supports roots (~/.opam/) for the current version,
665       it does provide backwards compatibility for its command-line interface.
666
667       Since CLI version support was only added in opam 2.1, use OPAMCLI to
668       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
669       for 2.1 (or later) versions, since an environment variable controlling
670       the parsing of syntax is brittle. To this end, opam displays a warning
671       if OPAMCLI specifies a valid version other than 2.0, and also if
672       `--cli=2.0' is specified.
673
674       The command-line version is selected by using the `--cli' option or the
675       OPAMCLI environment variable. `--cli' may be specified morethan once,
676       where the last instance takes precedence. OPAMCLI is only inspected if
677       `--cli' is not given.
678

EXIT STATUS

680       As an exception to the following, the `exec' command returns 127 if the
681       command was not found or couldn't be executed, and the command's exit
682       value otherwise.
683
684       0   Success, or true for boolean queries.
685
686       1   False. Returned when a boolean return value is expected, e.g. when
687           running with --check, or for queries like opam lint.
688
689       2   Bad command-line arguments, or command-line arguments pointing to
690           an invalid context (e.g. file not following the expected format).
691
692       5   Not found. You requested something (package, version, repository,
693           etc.) that couldn't be found.
694
695       10  Aborted. The operation required confirmation, which wasn't given.
696
697       15  Could not acquire the locks required for the operation.
698
699       20  There is no solution to the user request. This can be caused by
700           asking to install two incompatible packages, for example.
701
702       30  Error in package definition, or other metadata files. Using
703           --strict raises this error more often.
704
705       31  Package script error. Some package operations were unsuccessful.
706           This may be an error in the packages or an incompatibility with
707           your system. This can be a partial error.
708
709       40  Sync error. Could not fetch some remotes from the network. This can
710           be a partial error.
711
712       50  Configuration error. Opam or system configuration doesn't allow
713           operation, and needs fixing.
714
715       60  Solver failure. The solver failed to return a sound answer. It can
716           be due to a broken external solver, or an error in solver
717           configuration.
718
719       99  Internal error. Something went wrong, likely due to a bug in opam
720           itself.
721
722       130 User interrupt. SIGINT was received, generally due to the user
723           pressing Ctrl-C.
724

FURTHER DOCUMENTATION

726       See https://opam.ocaml.org/doc.
727

AUTHORS

729       Vincent Bernardoff <vb@luminar.eu.org>
730       Raja Boujbel <raja.boujbel@ocamlpro.com>
731       Roberto Di Cosmo <roberto@dicosmo.org>
732       Thomas Gazagnaire <thomas@gazagnaire.org>
733       Louis Gesbert <louis.gesbert@ocamlpro.com>
734       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
735       Anil Madhavapeddy <anil@recoil.org>
736       Guillem Rieu <guillem.rieu@ocamlpro.com>
737       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
738       Frederic Tuong <tuong@users.gforge.inria.fr>
739

BUGS

741       Check bug reports at https://github.com/ocaml/opam/issues.
742
743
744
745Opam 2.1.3                                                      OPAM-SWITCH(1)
Impressum