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       -j JOBS, --jobs=JOBS
43           Set the maximal number of concurrent jobs to use. The default value
44           is calculated from the number of cores. You can also set it using
45           the $OPAMJOBS environment variable.
46

PACKAGE BUILD OPTIONS

48       -b, --keep-build-dir
49           Keep the build directories after compiling packages. This is
50           equivalent to setting $OPAMKEEPBUILDDIR to "true".
51
52       -d, --with-doc, --build-doc
53           Build the package documentation. This only affects packages listed
54           on the command-line. The --build-doc form is deprecated as this
55           does also installation. This is equivalent to setting $OPAMWITHDOC
56           (or the deprecated $OPAMBUILDDOC) to "true".
57
58       --dry-run
59           Simulate the command, but don't actually perform any changes. This
60           also can be set with environment variable $OPAMDEBUG.
61
62       --fake
63           This option registers the actions into the opam database, without
64           actually performing them. WARNING: This option is dangerous and
65           likely to break your opam environment. You probably want
66           `--dry-run'. You've been warned.
67
68       --ignore-constraints-on[=PACKAGES] (default=)
69           Forces opam to ignore version constraints on all dependencies to
70           the listed packages. This can be used to test compatibility, but
71           expect builds to break when using this. Note that version
72           constraints on optional dependencies and conflicts are unaffected.
73           This is equivalent to setting $OPAMIGNORECONSTRAINTS.
74
75       --inplace-build
76           When compiling a package which has its source bound to a local
77           directory, process the build and install actions directly in that
78           directory, rather than in a clean copy handled by opam. This only
79           affects packages that are explicitly listed on the command-line.
80           This is equivalent to setting $OPAMINPLACEBUILD to "true".
81
82       --locked[=SUFFIX] (default=locked)
83           In commands that use opam files found from pinned sources, if a
84           variant of the file with an added .SUFFIX extension is found (e.g.
85           foo.opam.locked besides foo.opam), that will be used instead. This
86           is typically useful to offer a more specific set of dependencies
87           and reproduce similar build contexts, hence the name. The opam lock
88           plugin can be used to generate such files, based on the versions of
89           the dependencies currently installed on the host. This is
90           equivalent to setting the $OPAMLOCKED environment variable. Note
91           that this option doesn't generally affect already pinned packages.
92
93       -m MAKE, --make=MAKE
94           Use MAKE as the default 'make' command. Deprecated: use opam config
95           set[-global] make MAKE instead. Has no effect if the make variable
96           is defined.
97
98       --no-checksums
99           Do not verify the checksum of downloaded archives.This is
100           equivalent to setting $OPAMNOCHECKSUMS to "true".
101
102       --require-checksums
103           Reject the installation of packages that don't provide a checksum
104           for the upstream archives. This is equivalent to setting
105           $OPAMREQUIRECHECKSUMS to "true".
106
107       --reuse-build-dir
108           Reuse existing build directories (kept by using --keep-build-dir),
109           instead of compiling from a fresh clone of the source. This can be
110           faster, but also lead to failures if the build systems of the
111           packages don't handle upgrades of dependencies well. This is
112           equivalent to setting $OPAMREUSEBUILDDIR to "true".
113
114       --show-actions
115           Call the solver and display the actions. Don't perform any changes.
116           This is equivalent to setting $OPAMSHOW.
117
118       --skip-updates
119           When running an install, upgrade or reinstall on source-pinned
120           packages, they are normally updated from their origin first. This
121           flag disables that behaviour and will keep them to their version in
122           cache. This is equivalent to setting $OPAMSKIPUPDATE.
123
124       -t, --with-test, --build-test
125           Build and run the package unit-tests. This only affects packages
126           listed on the command-line. The --build-test form is deprecated as
127           this also affects installation. This is equivalent to setting
128           $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
129
130       --unlock-base
131           Allow changes to the packages set as switch base (typically, the
132           main compiler). Use with caution. This is equivalent to setting the
133           $OPAMUNLOCKBASE environment variable
134

COMMON OPTIONS

136       These options are common to all commands.
137
138       --best-effort
139           Don't fail if all requested packages can't be installed: try to
140           install as many as possible. Note that not all external solvers may
141           support this option (recent versions of aspcud or mccs should).
142           This is equivalent to setting $OPAMBESTEFFORT environment variable.
143
144       --color=WHEN
145           Colorize the output. WHEN must be one of `always', `never' or
146           `auto'.
147
148       --criteria=CRITERIA
149           Specify user preferences for dependency solving for this run.
150           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
151           on the supported language, and the external solvers available, see
152           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
153           using solver preferences can be found at
154           http://www.dicosmo.org/Articles/usercriteria.pdf.
155
156       --cudf=FILENAME
157           Debug option: Save the CUDF requests sent to the solver to
158           FILENAME-<n>.cudf.
159
160       --debug
161           Print debug message to stderr. This is equivalent to setting
162           $OPAMDEBUG to "true".
163
164       --debug-level=LEVEL
165           Like --debug, but allows specifying the debug level (--debug sets
166           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
167
168       --git-version
169           Print the git version of opam, if set (i.e. you are using a
170           development version), and exit.
171
172       --help[=FMT] (default=auto)
173           Show this help in format FMT. The value FMT must be one of `auto',
174           `pager', `groff' or `plain'. With `auto', the format is `pager` or
175           `plain' whenever the TERM env var is `dumb' or undefined.
176
177       --ignore-pin-depends
178           Ignore extra pins required by packages that get pinned, either
179           manually through opam pin or through opam install DIR. This is
180           equivalent to setting IGNOREPINDEPENDS=true.
181
182       --json=FILENAME
183           Save the results of the opam run in a computer-readable file. If
184           the filename contains the character `%', it will be replaced by an
185           index that doesn't overwrite an existing file. Similar to setting
186           the $OPAMJSON variable.
187
188       --no-aspcud
189           Deprecated.
190
191       --no-auto-upgrade
192           When configuring or updating a repository that is written for an
193           earlier opam version (1.2), opam internally converts it to the
194           current format. This disables this behaviour. Note that
195           repositories should define their format version in a 'repo' file at
196           their root, or they will be assumed to be in the older format. It
197           is, in any case, preferable to upgrade the repositories manually
198           using opam admin upgrade [--mirror URL] when possible.
199
200       --no-self-upgrade
201           Opam will replace itself with a newer binary found at OPAMROOT/opam
202           if present. This disables this behaviour.
203
204       -q, --quiet
205           Disables --verbose.
206
207       --root=ROOT
208           Use ROOT as the current root path. This is equivalent to setting
209           $OPAMROOT to ROOT.
210
211       --safe, --readonly
212           Make sure nothing will be automatically updated or rewritten.
213           Useful for calling from completion scripts, for example. Will fail
214           whenever such an operation is needed ; also avoids waiting for
215           locks, skips interactive questions and overrides the $OPAMDEBUG
216           variable. This is equivalent to set environment variable $OPAMSAFE.
217
218       --solver=CMD
219           Specify the CUDF solver to use for resolving package installation
220           problems. This is either a predefined solver (this version of opam
221           supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
222           aspcud-old, packup), or a custom command that should contain the
223           variables %{input}%, %{output}%, %{criteria}%, and optionally
224           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
225
226       --strict
227           Fail whenever an error is found in a package definition or a
228           configuration file. The default is to continue silently if
229           possible.
230
231       --switch=SWITCH
232           Use SWITCH as the current compiler switch. This is equivalent to
233           setting $OPAMSWITCH to SWITCH.
234
235       --use-internal-solver
236           Disable any external solver, and use the built-in one (this
237           requires that opam has been compiled with a built-in solver). This
238           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
239
240       -v, --verbose
241           Be more verbose. One -v shows all package commands, repeat to also
242           display commands called internally (e.g. tar, curl, patch etc.)
243           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
244
245       --version
246           Show version information.
247
248       -w, --working-dir
249           Whenever updating packages that are bound to a local,
250           version-controlled directory, update to the current working state
251           of their source instead of the last committed state, or the ref
252           they are pointing to. This only affects packages explicitly listed
253           on the command-line.It can also be set with $OPAMWORKINGDIR.
254
255       -y, --yes
256           Answer yes to all yes/no questions without prompting. This is
257           equivalent to setting $OPAMYES to "true".
258

ENVIRONMENT VARIABLES

260       Opam makes use of the environment variables listed here. Boolean
261       variables should be set to "0", "no", "false" or the empty string to
262       disable, "1", "yes" or "true" to enable.
263
264       OPAMALLPARENS surround all filters with parenthesis
265
266       OPAMAUTOREMOVE see remove option `--auto-remove`
267
268       OPAMBESTEFFORT see option `--best-effort`
269
270       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
271       the criteria when the `--best-effort` option is set, and is expected to
272       maximise the `opam-query` property in the solution
273
274       OPAMCOLOR, when set to always or never, sets a default value for the
275       --color option.
276
277       OPAMCRITERIA specifies user preferences for dependency solving. The
278       default value depends on the solver version, use `config report` to
279       know the current setting. See also option --criteria
280
281       OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
282
283       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
284       for more options.
285
286       OPAMDEBUG see options `--debug' and `--debug-level'.
287
288       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
289
290       OPAMDRYRUN see option `--dry-run`
291
292       OPAMEDITOR sets the editor to use for opam file editing, overrides
293       $EDITOR and $VISUAL
294
295       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
296       fails. 0 to print all.
297
298       OPAMEXTERNALSOLVER see option `--solver'.
299
300       OPAMFAKE see option `--fake`
301
302       OPAMFETCH specifies how to download files: either `wget', `curl' or a
303       custom command where variables %{url}%, %{out}%, %{retry}%,
304       %{compress}% and %{checksum}% will be replaced. Overrides the
305       'download-command' value from the main config file.
306
307       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
308
309       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
310
311       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
312
313       OPAMJOBS sets the maximum number of parallel workers to run.
314
315       OPAMJSON log json output to the given file (use character `%' to index
316       the files)
317
318       OPAMLOCKED see install option `--locked`
319
320       OPAMLOGS logdir sets log directory, default is a temporary directory in
321       /tmp
322
323       OPAMMAKECMD set the system make command to use
324
325       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
326       in an earlier format to the current one, on 'update' or 'init'.
327
328       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
329       some backups. This skips some finalisers and may also help to get more
330       reliable backtraces
331
332       OPAMLOCKRETRIES sets the number of tries after which opam gives up
333       acquiring its lock and fails. <= 0 means infinite wait.
334
335       OPAMMERGEOUT merge process outputs, stderr on stdout
336
337       OPAMNO answer no to any question asked.
338
339       OPAMNOASPCUD Deprecated.
340
341       OPAMNOCHECKSUMS enables option --no-checksums when available.
342
343       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
344
345       OPAMPINKINDAUTO sets whether version control systems should be detected
346       when pinning to a local path. Enabled by default since 1.3.0.
347
348       OPAMPRECISETRACKING fine grain tracking of directories
349
350       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
351       available (e.g. for `opam install`).
352
353       OPAMRETRES sets the number of tries before failing downloads.
354
355       OPAMROOT see option `--root'. This is automatically set by `opam env
356       --root=DIR --set-root'.
357
358       OPAMROOTISOK don't complain when running as root.
359
360       OPAMSAFE see option `--safe'
361
362       OPAMSHOW see option `--show`
363
364       OPAMSKIPUPDATE see option `--skip-updates`
365
366       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
367       compatibility testing only.
368
369       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
370       60.0, set to 0 for unlimited. Note that all solvers may not support
371       this option.
372
373       OPAMSTATUSLINE display a dynamic status line showing what's currently
374       going on on the terminal. (one of one of `always', `never' or `auto')
375
376       OPAMSTATS display stats at the end of command
377
378       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
379
380       OPAMSWITCH see option `--switch'. Automatically set by `opam env
381       --switch=SWITCH --set-switch'.
382
383       OPAMUNLOCKBASE see install option `--unlock-base`
384
385       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
386       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
387       are set. See also option --criteria
388
389       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
390
391       OPAMUSEOPENSSL force openssl use for hash computing
392
393       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
394       or `auto'). By default `auto', which is determined from the locale).
395
396       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
397       Implies OPAMUTF8. This is set by default on OSX only.
398
399       OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
400       an opam repository update
401
402       OPAMVAR_var overrides the contents of the variable var when
403       substituting `%{var}%` strings in `opam` files.
404
405       OPAMVAR_package_var overrides the contents of the variable package:var
406       when substituting `%{package:var}%` strings in `opam` files.
407
408       OPAMVERBOSE see option `--verbose'.
409
410       OPAMWORKINGDIR see option `--working-dir`
411
412       OPAMYES see option `--yes'.
413

EXIT STATUS

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

FURTHER DOCUMENTATION

461       See https://opam.ocaml.org/doc.
462

AUTHORS

464       Vincent Bernardoff <vb@luminar.eu.org>
465       Raja Boujbel <raja.boujbel@ocamlpro.com>
466       Roberto Di Cosmo <roberto@dicosmo.org>
467       Thomas Gazagnaire <thomas@gazagnaire.org>
468       Louis Gesbert <louis.gesbert@ocamlpro.com>
469       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
470       Anil Madhavapeddy <anil@recoil.org>
471       Guillem Rieu <guillem.rieu@ocamlpro.com>
472       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
473       Frederic Tuong <tuong@users.gforge.inria.fr>
474

BUGS

476       Check bug reports at https://github.com/ocaml/opam/issues.
477
478
479
480Opam 2.0.6                                                     OPAM-UPGRADE(1)
Impressum