1OPAM ADMIN(1)                  Opam admin Manual                 OPAM ADMIN(1)
2
3
4

NAME

6       opam admin - Tools for repository administrators
7

SYNOPSIS

9       opam admin COMMAND ...
10

DESCRIPTION

12       This command can perform various actions on repositories in the opam
13       format. It is expected to be run from the root of a repository, i.e. a
14       directory containing a 'repo' file and a subdirectory 'packages/'
15       holding package definition within subdirectories. A 'compilers/'
16       subdirectory (opam repository format version < 2) will also be used by
17       the upgrade-format subcommand.
18

COMMANDS

20       add-constraint
21           Adds version constraints on all dependencies towards a given
22           package
23
24       add-hashes
25           Add archive hashes to an opam repository.
26
27       cache
28           Fills a local cache of package archives
29
30       check
31           Runs some consistency checks on a repository
32
33       filter
34           Filters a repository to only keep selected packages
35
36       help
37           Display help about opam admin and opam admin subcommands.
38
39       index
40           Generate an inclusive index file for serving over HTTP.
41
42       lint
43           Runs 'opam lint' and reports on a whole repository
44
45       list
46           Lists packages from a repository
47
48       upgrade
49           Upgrades repository from earlier opam versions.
50

COMMAND ALIASES

52       make
53           An alias for index.
54

OPTIONS

56       --no
57           Answer no to all opam yes/no questions without prompting. See also
58           --confirm-level. This is equivalent to setting $OPAMNO to "true".
59
60       -y, --yes
61           Answer yes to all opam yes/no questions without prompting. See also
62           --confirm-level. This is equivalent to setting $OPAMYES to "true".
63

COMMON OPTIONS

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

ENVIRONMENT

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

CLI VERSION

408       All scripts and programmatic invocations of opam should use `--cli' in
409       order to ensure that they work seamlessly with future versions of the
410       opam client. Additionally, blog posts or other documentation can
411       benefit, as it prevents information from becoming stale.
412
413       Although opam only supports roots (~/.opam/) for the current version,
414       it does provide backwards compatibility for its command-line interface.
415
416       Since CLI version support was only added in opam 2.1, use OPAMCLI to
417       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
418       for 2.1 (or later) versions, since an environment variable controlling
419       the parsing of syntax is brittle. To this end, opam displays a warning
420       if OPAMCLI specifies a valid version other than 2.0, and also if
421       `--cli=2.0' is specified.
422
423       The command-line version is selected by using the `--cli' option or the
424       OPAMCLI environment variable. `--cli' may be specified morethan once,
425       where the last instance takes precedence. OPAMCLI is only inspected if
426       `--cli' is not given.
427

EXIT STATUS

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

FURTHER DOCUMENTATION

475       See https://opam.ocaml.org/doc.
476

AUTHORS

478       Vincent Bernardoff <vb@luminar.eu.org>
479       Raja Boujbel <raja.boujbel@ocamlpro.com>
480       Roberto Di Cosmo <roberto@dicosmo.org>
481       Thomas Gazagnaire <thomas@gazagnaire.org>
482       Louis Gesbert <louis.gesbert@ocamlpro.com>
483       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
484       Anil Madhavapeddy <anil@recoil.org>
485       Guillem Rieu <guillem.rieu@ocamlpro.com>
486       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
487       Frederic Tuong <tuong@users.gforge.inria.fr>
488

BUGS

490       Check bug reports at https://github.com/ocaml/opam/issues.
491
492
493
494Opam admin 2.1.2                                                 OPAM ADMIN(1)
Impressum