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

NAME

6       opam-update - Update the list of available packages.
7

SYNOPSIS

9       opam update [OPTION]… [NAMES]…
10

DESCRIPTION

12       Update the package definitions. This fetches the newest version of the
13       repositories configured through  opam repository, and the sources of
14       installed development packages and packages pinned in the current
15       switch. To use the updated sources and definitions, use opam upgrade.
16

ARGUMENTS

18       NAMES
19           List of repository or development package names to update.
20

OPTIONS

22       -a, --all
23           Update all configured repositories, not only what is set in the
24           current switch
25
26       --check
27           Do the update, then return with code 0 if there were any upstream
28           changes, 1 if there were none. Repositories or development packages
29           that failed to update are considered without changes. With
30           --upgrade, applies to the upgrade step: that is opam update
31           --upgrade --check behaves like opam update && opam upgrade --check,
32           returning 0 if there are available upgrades, rather than upstream
33           updates.
34
35       --depexts
36           Request the system package manager to update its databases
37           (skipping all opam packages, unless --development or --repositories
38           is also specified). This generally requires sudo rights.
39
40       --development
41           Update development packages (skipping repositories unless
42           --repositories is also specified).
43
44       -j JOBS, --jobs=JOBS
45           Set the maximal number of concurrent jobs to use. The default value
46           is calculated from the number of cores. You can also set it using
47           the $OPAMJOBS environment variable.
48
49       --no
50           Answer no to all opam yes/no questions without prompting. See also
51           --confirm-level. This is equivalent to setting $OPAMNO to "true".
52
53       -R, --repositories
54           Update repositories (skipping development packages unless
55           --development is also specified).
56
57       -u, --upgrade
58           Automatically run opam upgrade after the update.
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 auto.
83
84       --confirm-level=LEVEL
85           Confirmation level, LEVEL must be one of ask, no, yes or
86           unsafe-yes. Can be specified more than once. If --yes or --no are
87           also given, the value of the last --confirm-level is taken into
88           account. This is equivalent to setting  $OPAMCONFIRMLEVEL`.
89
90       --criteria=CRITERIA
91           Specify user preferences for dependency solving for this run.
92           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
93           on the supported language, and the external solvers available, see
94           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
95           using solver preferences can be found at
96           http://www.dicosmo.org/Articles/usercriteria.pdf.
97
98       --cudf=FILENAME
99           Debug option: Save the CUDF requests sent to the solver to
100           FILENAME-<n>.cudf.
101
102       --debug
103           Print debug message to stderr. This is equivalent to setting
104           $OPAMDEBUG to "true".
105
106       --debug-level=LEVEL
107           Like --debug, but allows specifying the debug level (--debug sets
108           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
109
110       --git-version
111           Print the git version of opam, if set (i.e. you are using a
112           development version), and exit.
113
114       --help[=FMT] (default=auto)
115           Show this help in format FMT. The value FMT must be one of auto,
116           pager, groff or plain. With auto, the format is pager or plain
117           whenever the TERM env var is dumb or undefined.
118
119       --ignore-pin-depends
120           Ignore extra pins required by packages that get pinned, either
121           manually through opam pin or through opam install DIR. This is
122           equivalent to setting IGNOREPINDEPENDS=true.
123
124       --json=FILENAME
125           Save the results of the opam run in a computer-readable file. If
126           the filename contains the character `%', it will be replaced by an
127           index that doesn't overwrite an existing file. Similar to setting
128           the $OPAMJSON variable.
129
130       --no-aspcud
131           Removed in 2.1.
132
133       --no-auto-upgrade
134           When configuring or updating a repository that is written for an
135           earlier opam version (1.2), opam internally converts it to the
136           current format. This disables this behaviour. Note that
137           repositories should define their format version in a 'repo' file at
138           their root, or they will be assumed to be in the older format. It
139           is, in any case, preferable to upgrade the repositories manually
140           using opam admin upgrade [--mirror URL] when possible.
141
142       --no-self-upgrade
143           Opam will replace itself with a newer binary found at OPAMROOT/opam
144           if present. This disables this behaviour.
145
146       -q, --quiet
147           Disables --verbose.
148
149       --root=ROOT
150           Use ROOT as the current root path. This is equivalent to setting
151           $OPAMROOT to ROOT.
152
153       --safe, --readonly
154           Make sure nothing will be automatically updated or rewritten.
155           Useful for calling from completion scripts, for example. Will fail
156           whenever such an operation is needed ; also avoids waiting for
157           locks, skips interactive questions and overrides the $OPAMDEBUG
158           variable. This is equivalent to set environment variable $OPAMSAFE.
159
160       --solver=CMD
161           Specify the CUDF solver to use for resolving package installation
162           problems. This is either a predefined solver (this version of opam
163           supports builtin-mccs+lp(), builtin-mccs+glpk,
164           builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
165           mccs, aspcud-old, packup), or a custom command that should contain
166           the variables %{input}%, %{output}%, %{criteria}%, and optionally
167           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
168
169       --strict
170           Fail whenever an error is found in a package definition or a
171           configuration file. The default is to continue silently if
172           possible.
173
174       --switch=SWITCH
175           Use SWITCH as the current compiler switch. This is equivalent to
176           setting $OPAMSWITCH to SWITCH.
177
178       --use-internal-solver
179           Disable any external solver, and use the built-in one (this
180           requires that opam has been compiled with a built-in solver). This
181           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
182
183       -v, --verbose
184           Be more verbose. One -v shows all package commands, repeat to also
185           display commands called internally (e.g. tar, curl, patch etc.)
186           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
187
188       --version
189           Show version information.
190
191       -w, --working-dir
192           Whenever updating packages that are bound to a local,
193           version-controlled directory, update to the current working state
194           of their source instead of the last committed state, or the ref
195           they are pointing to. As source directory is copied as it is, if it
196           isn't clean it may result on a opam build failure.This only affects
197           packages explicitly listed on the command-line.It can also be set
198           with $OPAMWORKINGDIR.
199

ENVIRONMENT

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

CLI VERSION

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

EXIT STATUS

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

FURTHER DOCUMENTATION

478       See https://opam.ocaml.org/doc.
479

AUTHORS

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

BUGS

493       Check bug reports at https://github.com/ocaml/opam/issues.
494
495
496
497Opam 2.1.5                                                      OPAM-UPDATE(1)
Impressum