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

NAME

6       opam-upgrade - Upgrade the installed package to latest version.
7

SYNOPSIS

9       opam upgrade [OPTION]... [PACKAGES]...
10

DESCRIPTION

12       This command upgrades the installed packages to their latest available
13       versions. More precisely, this command calls the dependency solver to
14       find a consistent state where most of the installed packages are
15       upgraded to their latest versions.
16
17       If a directory is specified as argument, anything that is pinned to
18       that directory is selected for upgrade.
19

ARGUMENTS

21       PACKAGES
22           List of package names, with an optional version or constraint, e.g
23           `pkg', `pkg.1.0' or `pkg>=0.5' ; or directory names containing
24           package description, with explicit directory (e.g. `./srcdir' or
25           `.')
26

OPTIONS

28       -a, --all
29           Run an upgrade of all installed packages. This is the default if
30           PACKAGES was not specified, and can be useful with PACKAGES to
31           upgrade while ensuring that some packages get or remain installed.
32
33       --check
34           Don't run the upgrade: just check if anything could be upgraded.
35           Returns 0 if that is the case, 1 if there is nothing that can be
36           upgraded.
37
38       --fixup
39           Recover from a broken state (eg. missing dependencies, two
40           conflicting packages installed together...).
41
42       --installed
43           When a directory is provided as argument, do not install pinned
44           package that are not yet installed.
45
46       -j JOBS, --jobs=JOBS
47           Set the maximal number of concurrent jobs to use. The default value
48           is calculated from the number of cores. You can also set it using
49           the $OPAMJOBS environment variable.
50
51       --no
52           Answer no to all opam yes/no questions without prompting. See also
53           --confirm-level. This is equivalent to setting $OPAMNO to "true".
54
55       -y, --yes
56           Answer yes to all opam yes/no questions without prompting. See also
57           --confirm-level. This is equivalent to setting $OPAMYES to "true".
58

PACKAGE BUILD OPTIONS

60       --assume-depexts
61           Skip the installation step for any missing system packages, and
62           attempt to proceed with compilation of the opam packages anyway. If
63           the installation is successful, opam won't prompt again about these
64           system packages. Only meaningful if external dependency handling is
65           enabled.
66
67       -b, --keep-build-dir
68           Keep the build directories after compiling packages. This is
69           equivalent to setting $OPAMKEEPBUILDDIR to "true".
70
71       --build-doc
72           Removed in 2.1, use --with-doc instead.
73
74       --build-test
75           Removed in 2.1, use --with-test instead.
76
77       -d, --with-doc
78           Build the package documentation. This only affects packages listed
79           on the command-line. This is equivalent to setting $OPAMWITHDOC (or
80           the deprecated $OPAMBUILDDOC) to "true".
81
82       --dry-run
83           Simulate the command, but don't actually perform any changes. This
84           also can be set with environment variable $OPAMDEBUG.
85
86       --fake
87           This option registers the actions into the opam database, without
88           actually performing them. WARNING: This option is dangerous and
89           likely to break your opam environment. You probably want --dry-run.
90           You've been warned.
91
92       --ignore-constraints-on[=PACKAGES] (default=)
93           Forces opam to ignore version constraints on all dependencies to
94           the listed packages. This can be used to test compatibility, but
95           expect builds to break when using this. Note that version
96           constraints on optional dependencies and conflicts are unaffected.
97           This is equivalent to setting $OPAMIGNORECONSTRAINTS.
98
99       --inplace-build
100           When compiling a package which has its source bound to a local
101           directory, process the build and install actions directly in that
102           directory, rather than in a clean copy handled by opam. This only
103           affects packages that are explicitly listed on the command-line.
104           This is equivalent to setting $OPAMINPLACEBUILD to "true".
105
106       --lock-suffix=SUFFIX (absent=locked)
107           Set locked files suffix to SUFFIX.
108
109       --locked
110           In commands that use opam files found from pinned sources, if a
111           variant of the file with an added .locked extension is found (e.g.
112           foo.opam.locked besides foo.opam), that will be used instead. This
113           is typically useful to offer a more specific set of dependencies
114           and reproduce similar build contexts, hence the name. The
115           lockoption can be used to generate such files, based on the
116           versions of the dependencies currently installed on the host. This
117           is equivalent to setting the $OPAMLOCKED environment variable. Note
118           that this option doesn't generally affect already pinned packages.
119
120       -m MAKE, --make=MAKE
121           Removed in 2.1, use opam config set[-global] make MAKE instead.
122
123       --no-checksums
124           Do not verify the checksum of downloaded archives.This is
125           equivalent to setting $OPAMNOCHECKSUMS to "true".
126
127       --no-depexts
128           Temporarily disables handling of external dependencies. This can be
129           used if a package is not available on your system package manager,
130           but you installed the required dependency by hand. Implies
131           --assume-depexts, and stores the exceptions upon success as well.
132
133       --require-checksums
134           Reject the installation of packages that don't provide a checksum
135           for the upstream archives. This is equivalent to setting
136           $OPAMREQUIRECHECKSUMS to "true".
137
138       --reuse-build-dir
139           Reuse existing build directories (kept by using --keep-build-dir),
140           instead of compiling from a fresh clone of the source. This can be
141           faster, but also lead to failures if the build systems of the
142           packages don't handle upgrades of dependencies well. This is
143           equivalent to setting $OPAMREUSEBUILDDIR to "true".
144
145       --show-actions
146           Call the solver and display the actions. Don't perform any changes.
147           This is equivalent to setting $OPAMSHOW.
148
149       --skip-updates
150           When running an install, upgrade or reinstall on source-pinned
151           packages, they are normally updated from their origin first. This
152           flag disables that behaviour and will keep them to their version in
153           cache. This is equivalent to setting $OPAMSKIPUPDATE.
154
155       -t, --with-test
156           Build and run the package unit-tests. This only affects packages
157           listed on the command-line. This is equivalent to setting
158           $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
159
160       --unlock-base
161           Removed in 2.1, use --update-invariant instead.
162
163       --update-invariant
164           Allow changes to the packages set as switch base (typically, the
165           main compiler). Use with caution. This is equivalent to setting the
166           $OPAMUNLOCKBASE environment variable
167

COMMON OPTIONS

169       These options are common to all commands.
170
171       --best-effort
172           Don't fail if all requested packages can't be installed: try to
173           install as many as possible. Note that not all external solvers may
174           support this option (recent versions of aspcud or mccs should).
175           This is equivalent to setting $OPAMBESTEFFORT environment variable.
176
177       --cli=MAJOR.MINOR (absent=2.1)
178           Use the command-line interface syntax and semantics of MAJOR.MINOR.
179           Intended for any persistent use of opam (scripts, blog posts,
180           etc.), any version of opam in the same MAJOR series will behave as
181           for the specified MINOR release. The flag was not available in opam
182           2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable
183           to 2.0 instead of using this parameter.
184
185       --color=WHEN
186           Colorize the output. WHEN must be one of `always', `never' or
187           `auto'.
188
189       --confirm-level=LEVEL
190           Confirmation level, LEVEL must be one of `ask', `no', `yes' or
191           `unsafe-yes'. Can be specified more than once. If --yes or --no are
192           also given, the value of the last --confirm-level is taken into
193           account. This is equivalent to setting  $OPAMCONFIRMLEVEL`.
194
195       --criteria=CRITERIA
196           Specify user preferences for dependency solving for this run.
197           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
198           on the supported language, and the external solvers available, see
199           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
200           using solver preferences can be found at
201           http://www.dicosmo.org/Articles/usercriteria.pdf.
202
203       --cudf=FILENAME
204           Debug option: Save the CUDF requests sent to the solver to
205           FILENAME-<n>.cudf.
206
207       --debug
208           Print debug message to stderr. This is equivalent to setting
209           $OPAMDEBUG to "true".
210
211       --debug-level=LEVEL
212           Like --debug, but allows specifying the debug level (--debug sets
213           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
214
215       --git-version
216           Print the git version of opam, if set (i.e. you are using a
217           development version), and exit.
218
219       --help[=FMT] (default=auto)
220           Show this help in format FMT. The value FMT must be one of `auto',
221           `pager', `groff' or `plain'. With `auto', the format is `pager` or
222           `plain' whenever the TERM env var is `dumb' or undefined.
223
224       --ignore-pin-depends
225           Ignore extra pins required by packages that get pinned, either
226           manually through opam pin or through opam install DIR. This is
227           equivalent to setting IGNOREPINDEPENDS=true.
228
229       --json=FILENAME
230           Save the results of the opam run in a computer-readable file. If
231           the filename contains the character `%', it will be replaced by an
232           index that doesn't overwrite an existing file. Similar to setting
233           the $OPAMJSON variable.
234
235       --no-aspcud
236           Removed in 2.1.
237
238       --no-auto-upgrade
239           When configuring or updating a repository that is written for an
240           earlier opam version (1.2), opam internally converts it to the
241           current format. This disables this behaviour. Note that
242           repositories should define their format version in a 'repo' file at
243           their root, or they will be assumed to be in the older format. It
244           is, in any case, preferable to upgrade the repositories manually
245           using opam admin upgrade [--mirror URL] when possible.
246
247       --no-self-upgrade
248           Opam will replace itself with a newer binary found at OPAMROOT/opam
249           if present. This disables this behaviour.
250
251       -q, --quiet
252           Disables --verbose.
253
254       --root=ROOT
255           Use ROOT as the current root path. This is equivalent to setting
256           $OPAMROOT to ROOT.
257
258       --safe, --readonly
259           Make sure nothing will be automatically updated or rewritten.
260           Useful for calling from completion scripts, for example. Will fail
261           whenever such an operation is needed ; also avoids waiting for
262           locks, skips interactive questions and overrides the $OPAMDEBUG
263           variable. This is equivalent to set environment variable $OPAMSAFE.
264
265       --solver=CMD
266           Specify the CUDF solver to use for resolving package installation
267           problems. This is either a predefined solver (this version of opam
268           supports builtin-mccs+lp(), builtin-mccs+glpk,
269           builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
270           mccs, aspcud-old, packup), or a custom command that should contain
271           the variables %{input}%, %{output}%, %{criteria}%, and optionally
272           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
273
274       --strict
275           Fail whenever an error is found in a package definition or a
276           configuration file. The default is to continue silently if
277           possible.
278
279       --switch=SWITCH
280           Use SWITCH as the current compiler switch. This is equivalent to
281           setting $OPAMSWITCH to SWITCH.
282
283       --use-internal-solver
284           Disable any external solver, and use the built-in one (this
285           requires that opam has been compiled with a built-in solver). This
286           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
287
288       -v, --verbose
289           Be more verbose. One -v shows all package commands, repeat to also
290           display commands called internally (e.g. tar, curl, patch etc.)
291           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
292
293       --version
294           Show version information.
295
296       -w, --working-dir
297           Whenever updating packages that are bound to a local,
298           version-controlled directory, update to the current working state
299           of their source instead of the last committed state, or the ref
300           they are pointing to. As source directory is copied as it is, if it
301           isn't clean it may result on a opam build failure.This only affects
302           packages explicitly listed on the command-line.It can also be set
303           with $OPAMWORKINGDIR.
304

ENVIRONMENT

306       Opam makes use of the environment variables listed here. Boolean
307       variables should be set to "0", "no", "false" or the empty string to
308       disable, "1", "yes" or "true" to enable.
309
310       OPAMALLPARENS surround all filters with parenthesis.
311
312       OPAMASSUMEDEPEXTS see option `--assume-depexts'.
313
314       OPAMAUTOREMOVE see remove option `--auto-remove'.
315
316       OPAMBESTEFFORT see option `--best-effort'.
317
318       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
319       the criteria when the `--best-effort' option is set, and is expected to
320       maximise the `opam-query' property in the solution.
321
322       OPAMBUILDDOC Removed in 2.1.
323
324       OPAMBUILDTEST Removed in 2.1.
325
326       OPAMCLI see option `--cli'.
327
328       OPAMCOLOR when set to always or never, sets a default value for the
329       `--color' option.
330
331       OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
332       priority over OPAMYES and OPAMNO.
333
334       OPAMCRITERIA specifies user preferences for dependency solving. The
335       default value depends on the solver version, use `config report' to
336       know the current setting. See also option --criteria.
337
338       OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
339
340       OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
341       preprocessing.
342
343       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
344       for more options.
345
346       OPAMDEBUG see options `--debug' and `--debug-level'.
347
348       OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
349       list of sections. Sections can optionally have a specific debug level
350       (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
351       `--debug-level'.
352
353       OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
354       CUDF preprocessing is.
355
356       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
357
358       OPAMDROPWORKINGDIR overrides packages previously updated with
359       --working-dir on update. Without this variable set, opam would keep
360       them unchanged unless explicitly named on the command-line.
361
362       OPAMDRYRUN see option `--dry-run'.
363
364       OPAMEDITOR sets the editor to use for opam file editing, overrides
365       $EDITOR and $VISUAL.
366
367       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
368       fails. 0 to print all.
369
370       OPAMEXTERNALSOLVER see option `--solver'.
371
372       OPAMFAKE see option `--fake'.
373
374       OPAMFETCH specifies how to download files: either `wget', `curl' or a
375       custom command where variables %{url}%, %{out}%, %{retry}%,
376       %{compress}% and %{checksum}% will be replaced. Overrides the
377       'download-command' value from the main config file.
378
379       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
380
381       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
382
383       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
384
385       OPAMINPLACEBUILD see option `--inplace-build'.
386
387       OPAMJOBS sets the maximum number of parallel workers to run.
388
389       OPAMJSON log json output to the given file (use character `%' to index
390       the files).
391
392       OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
393
394       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
395       some backups. This skips some finalisers and may also help to get more
396       reliable backtraces.
397
398       OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
399
400       OPAMLOGS logdir sets log directory, default is a temporary directory in
401       /tmp
402
403       OPAMMAKECMD set the system make command to use.
404
405       OPAMMERGEOUT merge process outputs, stderr on stdout.
406
407       OPAMNO answer no to any question asked, see options `--no` and
408       `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
409       OPAMYES is set.
410
411       OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
412
413       OPAMNOASPCUD Deprecated.
414
415       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
416       in an earlier format to the current one, on 'update' or 'init'.
417
418       OPAMNOCHECKSUMS enables option --no-checksums when available.
419
420       OPAMNODEPEXTS disables system dependencies handling, see option
421       `--no-depexts'.
422
423       OPAMNOENVNOTICE Internal.
424
425       OPAMNOSELFUPGRADE see option `--no-self-upgrade'
426
427       OPAMPINKINDAUTO sets whether version control systems should be detected
428       when pinning to a local path. Enabled by default since 1.3.0.
429
430       OPAMPRECISETRACKING fine grain tracking of directories.
431
432       OPAMPREPRO set this to false to disable CUDF preprocessing. Less
433       efficient, but might help debugging solver issue.
434
435       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
436       available (e.g. for `opam install').
437
438       OPAMRETRIES sets the number of tries before failing downloads.
439
440       OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
441
442       OPAMROOT see option `--root'. This is automatically set by `opam env
443       --root=DIR --set-root'.
444
445       OPAMROOTISOK don't complain when running as root.
446
447       OPAMSAFE see option `--safe'.
448
449       OPAMSHOW see option `--show'.
450
451       OPAMSKIPUPDATE see option `--skip-updates'.
452
453       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
454       compatibility testing only.
455
456       OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
457       return a solution when they reach timeout; while the solution remains
458       assured to be consistent, there is no guarantee in this case that it
459       fits the expected optimisation criteria. If `true', opam willcontinue
460       with a warning, if `false' a timeout is an error. Currently only the
461       builtin-z3 backend handles this degraded case.
462
463       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
464       60.0, set to 0 for unlimited. Note that all solvers may not support
465       this option.
466
467       OPAMSTATS display stats at the end of command.
468
469       OPAMSTATUSLINE display a dynamic status line showing what's currently
470       going on on the terminal. (one of one of `always', `never' or `auto')
471
472       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
473
474       OPAMSWITCH see option `--switch'. Automatically set by `opam env
475       --switch=SWITCH --set-switch'.
476
477       OPAMUNLOCKBASE see install option `--unlock-base'.
478
479       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
480       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
481       are set. See also option --criteria.
482
483       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
484
485       OPAMUSEOPENSSL force openssl use for hash computing.
486
487       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
488       or `auto'). By default `auto', which is determined from the locale).
489
490       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
491       Implies OPAMUTF8. This is set by default on OSX only.
492
493       OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
494       opam repository update.
495
496       OPAMVERBOSE see option `--verbose'.
497
498       OPAMVERSIONLAGPOWER do not use.
499
500       OPAMWITHDOC see install option `--with-doc'.
501
502       OPAMWITHTEST see install option `--with-test.
503
504       OPAMWORKINGDIR see option `--working-dir'.
505
506       OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
507       priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
508
509       OPAMVAR_var overrides the contents of the variable var when
510       substituting `%{var}%` strings in `opam` files.
511
512       OPAMVAR_package_var overrides the contents of the variable package:var
513       when substituting `%{package:var}%` strings in `opam` files.
514

CLI VERSION

516       All scripts and programmatic invocations of opam should use `--cli' in
517       order to ensure that they work seamlessly with future versions of the
518       opam client. Additionally, blog posts or other documentation can
519       benefit, as it prevents information from becoming stale.
520
521       Although opam only supports roots (~/.opam/) for the current version,
522       it does provide backwards compatibility for its command-line interface.
523
524       Since CLI version support was only added in opam 2.1, use OPAMCLI to
525       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
526       for 2.1 (or later) versions, since an environment variable controlling
527       the parsing of syntax is brittle. To this end, opam displays a warning
528       if OPAMCLI specifies a valid version other than 2.0, and also if
529       `--cli=2.0' is specified.
530
531       The command-line version is selected by using the `--cli' option or the
532       OPAMCLI environment variable. `--cli' may be specified morethan once,
533       where the last instance takes precedence. OPAMCLI is only inspected if
534       `--cli' is not given.
535

EXIT STATUS

537       As an exception to the following, the `exec' command returns 127 if the
538       command was not found or couldn't be executed, and the command's exit
539       value otherwise.
540
541       0   Success, or true for boolean queries.
542
543       1   False. Returned when a boolean return value is expected, e.g. when
544           running with --check, or for queries like opam lint.
545
546       2   Bad command-line arguments, or command-line arguments pointing to
547           an invalid context (e.g. file not following the expected format).
548
549       5   Not found. You requested something (package, version, repository,
550           etc.) that couldn't be found.
551
552       10  Aborted. The operation required confirmation, which wasn't given.
553
554       15  Could not acquire the locks required for the operation.
555
556       20  There is no solution to the user request. This can be caused by
557           asking to install two incompatible packages, for example.
558
559       30  Error in package definition, or other metadata files. Using
560           --strict raises this error more often.
561
562       31  Package script error. Some package operations were unsuccessful.
563           This may be an error in the packages or an incompatibility with
564           your system. This can be a partial error.
565
566       40  Sync error. Could not fetch some remotes from the network. This can
567           be a partial error.
568
569       50  Configuration error. Opam or system configuration doesn't allow
570           operation, and needs fixing.
571
572       60  Solver failure. The solver failed to return a sound answer. It can
573           be due to a broken external solver, or an error in solver
574           configuration.
575
576       99  Internal error. Something went wrong, likely due to a bug in opam
577           itself.
578
579       130 User interrupt. SIGINT was received, generally due to the user
580           pressing Ctrl-C.
581

FURTHER DOCUMENTATION

583       See https://opam.ocaml.org/doc.
584

AUTHORS

586       Vincent Bernardoff <vb@luminar.eu.org>
587       Raja Boujbel <raja.boujbel@ocamlpro.com>
588       Roberto Di Cosmo <roberto@dicosmo.org>
589       Thomas Gazagnaire <thomas@gazagnaire.org>
590       Louis Gesbert <louis.gesbert@ocamlpro.com>
591       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
592       Anil Madhavapeddy <anil@recoil.org>
593       Guillem Rieu <guillem.rieu@ocamlpro.com>
594       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
595
596       Frederic Tuong <tuong@users.gforge.inria.fr>
597

BUGS

599       Check bug reports at https://github.com/ocaml/opam/issues.
600
601
602
603Opam 2.1.1                                                     OPAM-UPGRADE(1)
Impressum