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

NAME

6       opam admin-upgrade - Upgrades repository from earlier opam versions.
7

SYNOPSIS

9       opam admin upgrade [OPTION]…
10

DESCRIPTION

12       This command reads repositories from earlier opam versions, and
13       converts them to repositories suitable for the current opam version.
14       Packages might be created or renamed, and any compilers defined in the
15       old format ('compilers/' directory) will be turned into packages, using
16       a pre-defined hierarchy that assumes OCaml compilers.
17

OPTIONS

19       --clear-cache
20           Instead of running the upgrade, clear the cache of archive hashes
21           (held in ~/.cache), that is used to avoid re-downloading files to
22           obtain their hashes at every run.
23
24       -m URL, --mirror=URL
25           Don't overwrite the current repository, but put an upgraded mirror
26           in place in a subdirectory, with proper redirections. Needs the URL
27           the repository will be served from to put in the redirects (older
28           versions of opam don't understand relative redirects).
29
30       --no
31           Answer no to all opam yes/no questions without prompting. See also
32           --confirm-level. This is equivalent to setting $OPAMNO to "true".
33
34       -y, --yes
35           Answer yes to all opam yes/no questions without prompting. See also
36           --confirm-level. This is equivalent to setting $OPAMYES to "true".
37

COMMON OPTIONS

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

ENVIRONMENT

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

CLI VERSION

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

EXIT STATUS

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

FURTHER DOCUMENTATION

448       See https://opam.ocaml.org/doc.
449

AUTHORS

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

BUGS

463       Check bug reports at https://github.com/ocaml/opam/issues.
464
465
466
467Opam admin 2.1.3                                         OPAM ADMIN-UPGRADE(1)
Impressum