1OPAM-UPDATE(1) Opam Manual OPAM-UPDATE(1)
2
3
4
6 opam-update - Update the list of available packages.
7
9 opam update [OPTION]... [NAMES]...
10
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
18 NAMES
19 List of repository or development package names to update.
20
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
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
83 `auto'.
84
85 --confirm-level=LEVEL
86 Confirmation level, LEVEL must be one of `ask', `no', `yes' or
87 `unsafe-yes'. Can be specified more than once. If --yes or --no are
88 also given, the value of the last --confirm-level is taken into
89 account. This is equivalent to setting $OPAMCONFIRMLEVEL`.
90
91 --criteria=CRITERIA
92 Specify user preferences for dependency solving for this run.
93 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
94 on the supported language, and the external solvers available, see
95 http://opam.ocaml.org/doc/External_solvers.html. A general guide to
96 using solver preferences can be found at
97 http://www.dicosmo.org/Articles/usercriteria.pdf.
98
99 --cudf=FILENAME
100 Debug option: Save the CUDF requests sent to the solver to
101 FILENAME-<n>.cudf.
102
103 --debug
104 Print debug message to stderr. This is equivalent to setting
105 $OPAMDEBUG to "true".
106
107 --debug-level=LEVEL
108 Like --debug, but allows specifying the debug level (--debug sets
109 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
110
111 --git-version
112 Print the git version of opam, if set (i.e. you are using a
113 development version), and exit.
114
115 --help[=FMT] (default=auto)
116 Show this help in format FMT. The value FMT must be one of `auto',
117 `pager', `groff' or `plain'. With `auto', the format is `pager` or
118 `plain' whenever the TERM env var is `dumb' or undefined.
119
120 --ignore-pin-depends
121 Ignore extra pins required by packages that get pinned, either
122 manually through opam pin or through opam install DIR. This is
123 equivalent to setting IGNOREPINDEPENDS=true.
124
125 --json=FILENAME
126 Save the results of the opam run in a computer-readable file. If
127 the filename contains the character `%', it will be replaced by an
128 index that doesn't overwrite an existing file. Similar to setting
129 the $OPAMJSON variable.
130
131 --no-aspcud
132 Removed in 2.1.
133
134 --no-auto-upgrade
135 When configuring or updating a repository that is written for an
136 earlier opam version (1.2), opam internally converts it to the
137 current format. This disables this behaviour. Note that
138 repositories should define their format version in a 'repo' file at
139 their root, or they will be assumed to be in the older format. It
140 is, in any case, preferable to upgrade the repositories manually
141 using opam admin upgrade [--mirror URL] when possible.
142
143 --no-self-upgrade
144 Opam will replace itself with a newer binary found at OPAMROOT/opam
145 if present. This disables this behaviour.
146
147 -q, --quiet
148 Disables --verbose.
149
150 --root=ROOT
151 Use ROOT as the current root path. This is equivalent to setting
152 $OPAMROOT to ROOT.
153
154 --safe, --readonly
155 Make sure nothing will be automatically updated or rewritten.
156 Useful for calling from completion scripts, for example. Will fail
157 whenever such an operation is needed ; also avoids waiting for
158 locks, skips interactive questions and overrides the $OPAMDEBUG
159 variable. This is equivalent to set environment variable $OPAMSAFE.
160
161 --solver=CMD
162 Specify the CUDF solver to use for resolving package installation
163 problems. This is either a predefined solver (this version of opam
164 supports builtin-mccs+lp(), builtin-mccs+glpk,
165 builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
166 mccs, aspcud-old, packup), or a custom command that should contain
167 the variables %{input}%, %{output}%, %{criteria}%, and optionally
168 %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
169
170 --strict
171 Fail whenever an error is found in a package definition or a
172 configuration file. The default is to continue silently if
173 possible.
174
175 --switch=SWITCH
176 Use SWITCH as the current compiler switch. This is equivalent to
177 setting $OPAMSWITCH to SWITCH.
178
179 --use-internal-solver
180 Disable any external solver, and use the built-in one (this
181 requires that opam has been compiled with a built-in solver). This
182 is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
183
184 -v, --verbose
185 Be more verbose. One -v shows all package commands, repeat to also
186 display commands called internally (e.g. tar, curl, patch etc.)
187 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
188
189 --version
190 Show version information.
191
192 -w, --working-dir
193 Whenever updating packages that are bound to a local,
194 version-controlled directory, update to the current working state
195 of their source instead of the last committed state, or the ref
196 they are pointing to. As source directory is copied as it is, if it
197 isn't clean it may result on a opam build failure.This only affects
198 packages explicitly listed on the command-line.It can also be set
199 with $OPAMWORKINGDIR.
200
202 Opam makes use of the environment variables listed here. Boolean
203 variables should be set to "0", "no", "false" or the empty string to
204 disable, "1", "yes" or "true" to enable.
205
206 OPAMALLPARENS surround all filters with parenthesis.
207
208 OPAMASSUMEDEPEXTS see option `--assume-depexts'.
209
210 OPAMAUTOREMOVE see remove option `--auto-remove'.
211
212 OPAMBESTEFFORT see option `--best-effort'.
213
214 OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
215 the criteria when the `--best-effort' option is set, and is expected to
216 maximise the `opam-query' property in the solution.
217
218 OPAMBUILDDOC Removed in 2.1.
219
220 OPAMBUILDTEST Removed in 2.1.
221
222 OPAMCLI see option `--cli'.
223
224 OPAMCOLOR when set to always or never, sets a default value for the
225 `--color' option.
226
227 OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
228 priority over OPAMYES and OPAMNO.
229
230 OPAMCRITERIA specifies user preferences for dependency solving. The
231 default value depends on the solver version, use `config report' to
232 know the current setting. See also option --criteria.
233
234 OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
235
236 OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
237 preprocessing.
238
239 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
240 for more options.
241
242 OPAMDEBUG see options `--debug' and `--debug-level'.
243
244 OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
245 list of sections. Sections can optionally have a specific debug level
246 (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
247 `--debug-level'.
248
249 OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
250 CUDF preprocessing is.
251
252 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
253
254 OPAMDROPWORKINGDIR overrides packages previously updated with
255 --working-dir on update. Without this variable set, opam would keep
256 them unchanged unless explicitly named on the command-line.
257
258 OPAMDRYRUN see option `--dry-run'.
259
260 OPAMEDITOR sets the editor to use for opam file editing, overrides
261 $EDITOR and $VISUAL.
262
263 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
264 fails. 0 to print all.
265
266 OPAMEXTERNALSOLVER see option `--solver'.
267
268 OPAMFAKE see option `--fake'.
269
270 OPAMFETCH specifies how to download files: either `wget', `curl' or a
271 custom command where variables %{url}%, %{out}%, %{retry}%,
272 %{compress}% and %{checksum}% will be replaced. Overrides the
273 'download-command' value from the main config file.
274
275 OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
276
277 OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
278
279 OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
280
281 OPAMINPLACEBUILD see option `--inplace-build'.
282
283 OPAMJOBS sets the maximum number of parallel workers to run.
284
285 OPAMJSON log json output to the given file (use character `%' to index
286 the files).
287
288 OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
289
290 OPAMKEEPLOGS tells opam to not remove some temporary command logs and
291 some backups. This skips some finalisers and may also help to get more
292 reliable backtraces.
293
294 OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
295
296 OPAMLOGS logdir sets log directory, default is a temporary directory in
297 /tmp
298
299 OPAMMAKECMD set the system make command to use.
300
301 OPAMMERGEOUT merge process outputs, stderr on stdout.
302
303 OPAMNO answer no to any question asked, see options `--no` and
304 `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
305 OPAMYES is set.
306
307 OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
308
309 OPAMNOASPCUD Deprecated.
310
311 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
312 in an earlier format to the current one, on 'update' or 'init'.
313
314 OPAMNOCHECKSUMS enables option --no-checksums when available.
315
316 OPAMNODEPEXTS disables system dependencies handling, see option
317 `--no-depexts'.
318
319 OPAMNOENVNOTICE Internal.
320
321 OPAMNOSELFUPGRADE see option `--no-self-upgrade'
322
323 OPAMPINKINDAUTO sets whether version control systems should be detected
324 when pinning to a local path. Enabled by default since 1.3.0.
325
326 OPAMPRECISETRACKING fine grain tracking of directories.
327
328 OPAMPREPRO set this to false to disable CUDF preprocessing. Less
329 efficient, but might help debugging solver issue.
330
331 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
332 available (e.g. for `opam install').
333
334 OPAMRETRIES sets the number of tries before failing downloads.
335
336 OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
337
338 OPAMROOT see option `--root'. This is automatically set by `opam env
339 --root=DIR --set-root'.
340
341 OPAMROOTISOK don't complain when running as root.
342
343 OPAMSAFE see option `--safe'.
344
345 OPAMSHOW see option `--show'.
346
347 OPAMSKIPUPDATE see option `--skip-updates'.
348
349 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
350 compatibility testing only.
351
352 OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
353 return a solution when they reach timeout; while the solution remains
354 assured to be consistent, there is no guarantee in this case that it
355 fits the expected optimisation criteria. If `true', opam willcontinue
356 with a warning, if `false' a timeout is an error. Currently only the
357 builtin-z3 backend handles this degraded case.
358
359 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
360 60.0, set to 0 for unlimited. Note that all solvers may not support
361 this option.
362
363 OPAMSTATS display stats at the end of command.
364
365 OPAMSTATUSLINE display a dynamic status line showing what's currently
366 going on on the terminal. (one of one of `always', `never' or `auto')
367
368 OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
369
370 OPAMSWITCH see option `--switch'. Automatically set by `opam env
371 --switch=SWITCH --set-switch'.
372
373 OPAMUNLOCKBASE see install option `--unlock-base'.
374
375 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
376 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
377 are set. See also option --criteria.
378
379 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
380
381 OPAMUSEOPENSSL force openssl use for hash computing.
382
383 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
384 or `auto'). By default `auto', which is determined from the locale).
385
386 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
387 Implies OPAMUTF8. This is set by default on OSX only.
388
389 OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
390 opam repository update.
391
392 OPAMVERBOSE see option `--verbose'.
393
394 OPAMVERSIONLAGPOWER do not use.
395
396 OPAMWITHDOC see install option `--with-doc'.
397
398 OPAMWITHTEST see install option `--with-test.
399
400 OPAMWORKINGDIR see option `--working-dir'.
401
402 OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
403 priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
404
405 OPAMVAR_var overrides the contents of the variable var when
406 substituting `%{var}%` strings in `opam` files.
407
408 OPAMVAR_package_var overrides the contents of the variable package:var
409 when substituting `%{package:var}%` strings in `opam` files.
410
412 All scripts and programmatic invocations of opam should use `--cli' in
413 order to ensure that they work seamlessly with future versions of the
414 opam client. Additionally, blog posts or other documentation can
415 benefit, as it prevents information from becoming stale.
416
417 Although opam only supports roots (~/.opam/) for the current version,
418 it does provide backwards compatibility for its command-line interface.
419
420 Since CLI version support was only added in opam 2.1, use OPAMCLI to
421 select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
422 for 2.1 (or later) versions, since an environment variable controlling
423 the parsing of syntax is brittle. To this end, opam displays a warning
424 if OPAMCLI specifies a valid version other than 2.0, and also if
425 `--cli=2.0' is specified.
426
427 The command-line version is selected by using the `--cli' option or the
428 OPAMCLI environment variable. `--cli' may be specified morethan once,
429 where the last instance takes precedence. OPAMCLI is only inspected if
430 `--cli' is not given.
431
433 As an exception to the following, the `exec' command returns 127 if the
434 command was not found or couldn't be executed, and the command's exit
435 value otherwise.
436
437 0 Success, or true for boolean queries.
438
439 1 False. Returned when a boolean return value is expected, e.g. when
440 running with --check, or for queries like opam lint.
441
442 2 Bad command-line arguments, or command-line arguments pointing to
443 an invalid context (e.g. file not following the expected format).
444
445 5 Not found. You requested something (package, version, repository,
446 etc.) that couldn't be found.
447
448 10 Aborted. The operation required confirmation, which wasn't given.
449
450 15 Could not acquire the locks required for the operation.
451
452 20 There is no solution to the user request. This can be caused by
453 asking to install two incompatible packages, for example.
454
455 30 Error in package definition, or other metadata files. Using
456 --strict raises this error more often.
457
458 31 Package script error. Some package operations were unsuccessful.
459 This may be an error in the packages or an incompatibility with
460 your system. This can be a partial error.
461
462 40 Sync error. Could not fetch some remotes from the network. This can
463 be a partial error.
464
465 50 Configuration error. Opam or system configuration doesn't allow
466 operation, and needs fixing.
467
468 60 Solver failure. The solver failed to return a sound answer. It can
469 be due to a broken external solver, or an error in solver
470 configuration.
471
472 99 Internal error. Something went wrong, likely due to a bug in opam
473 itself.
474
475 130 User interrupt. SIGINT was received, generally due to the user
476 pressing Ctrl-C.
477
479 See https://opam.ocaml.org/doc.
480
482 Vincent Bernardoff <vb@luminar.eu.org>
483 Raja Boujbel <raja.boujbel@ocamlpro.com>
484 Roberto Di Cosmo <roberto@dicosmo.org>
485 Thomas Gazagnaire <thomas@gazagnaire.org>
486 Louis Gesbert <louis.gesbert@ocamlpro.com>
487 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
488 Anil Madhavapeddy <anil@recoil.org>
489 Guillem Rieu <guillem.rieu@ocamlpro.com>
490 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
491 Frederic Tuong <tuong@users.gforge.inria.fr>
492
494 Check bug reports at https://github.com/ocaml/opam/issues.
495
496
497
498Opam 2.1.1 OPAM-UPDATE(1)