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

ENVIRONMENT

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

CLI VERSION

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

EXIT STATUS

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

FURTHER DOCUMENTATION

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

AUTHORS

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

BUGS

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