1opam-upgrade(1) Opam Manual opam-upgrade(1)
2
3
4
6 opam-upgrade - Upgrade the installed package to latest version.
7
9 opam upgrade [OPTION]... [PACKAGES]...
10
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
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
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
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.
60
61 --fake
62 This option registers the actions into the opam database, without
63 actually performing them. WARNING: This option is dangerous and
64 likely to break your opam environment. You probably want
65 `--dry-run'. You've been warned.
66
67 --ignore-constraints-on[=PACKAGES] (default=)
68 Forces opam to ignore version constraints on all dependencies to
69 the listed packages. This can be used to test compatibility, but
70 expect builds to break when using this. Note that version
71 constraints on optional dependencies and conflicts are unaffected.
72
73 --inplace-build
74 When compiling a package which has its source bound to a local
75 directory, process the build and install actions directly in that
76 directory, rather than in a clean copy handled by opam. This only
77 affects packages that are explicitly listed on the command-line.
78 This is equivalent to setting $OPAMINPLACEBUILD to "true".
79
80 --locked[=SUFFIX] (default=locked)
81 In commands that use opam files found from pinned sources, if a
82 variant of the file with an added .SUFFIX extension is found (e.g.
83 foo.opam.locked besides foo.opam), that will be used instead. This
84 is typically useful to offer a more specific set of dependencies
85 and reproduce similar build contexts, hence the name. The opam lock
86 plugin can be used to generate such files, based on the versions of
87 the dependencies currently installed on the host. This is
88 equivalent to setting the $OPAMLOCK environment variable. Note that
89 this option doesn't generally affect already pinned packages.
90
91 -m MAKE, --make=MAKE
92 Use MAKE as the default 'make' command. Deprecated: use opam config
93 set[-global] make MAKE instead. Has no effect if the make variable
94 is defined.
95
96 --no-checksums
97 Do not verify the checksum of downloaded archives.This is
98 equivalent to setting $OPAMNOCHECKSUMS to "true".
99
100 --require-checksums
101 Reject the installation of packages that don't provide a checksum
102 for the upstream archives. This is equivalent to setting
103 $OPAMREQUIRECHECKSUMS to "true".
104
105 --reuse-build-dir
106 Reuse existing build directories (kept by using --keep-build-dir),
107 instead of compiling from a fresh clone of the source. This can be
108 faster, but also lead to failures if the build systems of the
109 packages don't handle upgrades of dependencies well. This is
110 equivalent to setting $OPAMREUSEBUILDDIR to "true".
111
112 --show-actions
113 Call the solver and display the actions. Don't perform any changes.
114
115 --skip-updates
116 When running an install, upgrade or reinstall on source-pinned
117 packages, they are normally updated from their origin first. This
118 flag disables that behaviour and will keep them to their version in
119 cache.
120
121 -t, --with-test, --build-test
122 Build and run the package unit-tests. This only affects packages
123 listed on the command-line. The --build-test form is deprecated as
124 this also affects installation. This is equivalent to setting
125 $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
126
127 --unlock-base
128 Allow changes to the packages set as switch base (typically, the
129 main compiler). Use with caution.
130
132 These options are common to all commands.
133
134 --best-effort
135 Don't fail if all requested packages can't be installed: try to
136 install as many as possible. Note that not all external solvers may
137 support this option (recent versions of aspcud or mccs should).
138
139 --color=WHEN
140 Colorize the output. WHEN must be one of `always', `never' or
141 `auto'.
142
143 --criteria=CRITERIA
144 Specify user preferences for dependency solving for this run.
145 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
146 on the supported language, and the external solvers available, see
147 http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A
148 general guide to using solver preferences can be found at
149 http://www.dicosmo.org/Articles/usercriteria.pdf.
150
151 --cudf=FILENAME
152 Debug option: Save the CUDF requests sent to the solver to
153 FILENAME-<n>.cudf.
154
155 --debug
156 Print debug message to stderr. This is equivalent to setting
157 $OPAMDEBUG to "true".
158
159 --debug-level=LEVEL
160 Like --debug, but allows specifying the debug level (--debug sets
161 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
162
163 --git-version
164 Print the git version of opam, if set (i.e. you are using a
165 development version), and exit.
166
167 --help[=FMT] (default=auto)
168 Show this help in format FMT. The value FMT must be one of `auto',
169 `pager', `groff' or `plain'. With `auto', the format is `pager` or
170 `plain' whenever the TERM env var is `dumb' or undefined.
171
172 --ignore-pin-depends
173 Ignore extra pins required by packages that get pinned, either
174 manually through opam pin or through opam install DIR. This is
175 equivalent to setting IGNOREPINDEPENDS=true.
176
177 --json=FILENAME
178 Save the results of the opam run in a computer-readable file. If
179 the filename contains the character `%', it will be replaced by an
180 index that doesn't overwrite an existing file. Similar to setting
181 the $OPAMJSON variable.
182
183 --no-auto-upgrade
184 When configuring or updating a repository that is written for an
185 earlier opam version (1.2), opam internally converts it to the
186 current format. This disables this behaviour. Note that
187 repositories should define their format version in a 'repo' file at
188 their root, or they will be assumed to be in the older format. It
189 is, in any case, preferable to upgrade the repositories manually
190 using opam admin upgrade [--mirror URL] when possible.
191
192 --no-self-upgrade
193 Opam will replace itself with a newer binary found at OPAMROOT/opam
194 if present. This disables this behaviour.
195
196 -q, --quiet
197 Disables --verbose.
198
199 --root=ROOT
200 Use ROOT as the current root path. This is equivalent to setting
201 $OPAMROOT to ROOT.
202
203 --safe, --readonly
204 Make sure nothing will be automatically updated or rewritten.
205 Useful for calling from completion scripts, for example. Will fail
206 whenever such an operation is needed ; also avoids waiting for
207 locks, skips interactive questions and overrides the $OPAMDEBUG
208 variable.
209
210 --solver=CMD
211 Specify the CUDF solver to use for resolving package installation
212 problems. This is either a predefined solver (this version of opam
213 supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
214 aspcud-old, packup), or a custom command that should contain the
215 variables %{input}%, %{output}%, %{criteria}%, and optionally
216 %{timeout}%.
217
218 --strict
219 Fail whenever an error is found in a package definition or a
220 configuration file. The default is to continue silently if
221 possible.
222
223 --switch=SWITCH
224 Use SWITCH as the current compiler switch. This is equivalent to
225 setting $OPAMSWITCH to SWITCH.
226
227 --use-internal-solver, --no-aspcud
228 Disable any external solver, and use the built-in one (this
229 requires that opam has been compiled with a built-in solver).
230
231 -v, --verbose
232 Be more verbose. One -v shows all package commands, repeat to also
233 display commands called internally (e.g. tar, curl, patch etc.)
234 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
235
236 --version
237 Show version information.
238
239 -w, --working-dir
240 Whenever updating packages that are bound to a local,
241 version-controlled directory, update to the current working state
242 of their source instead of the last committed state, or the ref
243 they are pointing to. This only affects packages explicitly listed
244 on the command-line.
245
246 -y, --yes
247 Answer yes to all yes/no questions without prompting. This is
248 equivalent to setting $OPAMYES to "true".
249
251 Opam makes use of the environment variables listed here. Boolean
252 variables should be set to "0", "no", "false" or the empty string to
253 disable, "1", "yes" or "true" to enable.
254
255 OPAMCOLOR, when set to always or never, sets a default value for the
256 --color option.
257
258 OPAMCRITERIA specifies user preferences for dependency solving. The
259 default value depends on the solver version, use `config report` to
260 know the current setting. See also option --criteria
261
262 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
263 for more options.
264
265 OPAMDEBUG see options `--debug' and `--debug-level'.
266
267 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
268
269 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
270 fails. 0 to print all.
271
272 OPAMEXTERNALSOLVER see option `--solver'.
273
274 OPAMFETCH specifies how to download files: either `wget', `curl' or a
275 custom command where variables %{url}%, %{out}%, %{retry}%,
276 %{compress}% and %{checksum}% will be replaced. Overrides the
277 'download-command' value from the main config file.
278
279 OPAMJOBS sets the maximum number of parallel workers to run.
280
281 OPAMJSON log json output to the given file (use character `%' to index
282 the files)
283
284 OPAMLOCK see option `--lock'.
285
286 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
287 in an earlier format to the current one, on 'update' or 'init'.
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 OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
294 acquiring its lock and fails. <= 0 means infinite wait.
295
296 OPAMNO answer no to any question asked.
297
298 OPAMNOASPCUD see option `--no-aspcud'.
299
300 OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
301
302 OPAMPINKINDAUTO sets whether version control systems should be detected
303 when pinning to a local path. Enabled by default since 1.3.0.
304
305 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
306 available (e.g. for `opam install`).
307
308 OPAMRETRY sets the number of tries before failing downloads.
309
310 OPAMROOT see option `--root'. This is automatically set by `opam env
311 --root=DIR --set-root'.
312
313 OPAMROOTISOK don't complain when running as root.
314
315 OPAMSAFE see option `--safe'
316
317 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
318 compatibility testing only.
319
320 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
321 60.0, set to 0 for unlimited. Note that all solvers may not support
322 this option.
323
324 OPAMSTATUSLINE display a dynamic status line showing what's currently
325 going on on the terminal. (one of one of `always', `never' or `auto')
326
327 OPAMSWITCH see option `--switch'. Automatically set by `opam env
328 --switch=SWITCH --set-switch'.
329
330 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
331 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
332 are set. See also option --criteria
333
334 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
335
336 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
337 or `auto'). By default `auto', which is determined from the locale).
338
339 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
340 Implies OPAMUTF8. This is set by default on OSX only.
341
342 OPAMVAR_var overrides the contents of the variable var when
343 substituting `%{var}%` strings in `opam` files.
344
345 OPAMVAR_package_var overrides the contents of the variable package:var
346 when substituting `%{package:var}%` strings in `opam` files.
347
348 OPAMVERBOSE see option `--verbose'.
349
350 OPAMYES see option `--yes'.
351
353 As an exception to the following, the `exec' command returns 127 if the
354 command was not found or couldn't be executed, and the command's exit
355 value otherwise.
356
357 0 Success, or true for boolean queries.
358
359 1 False. Returned when a boolean return value is expected, e.g. when
360 running with --check, or for queries like opam lint.
361
362 2 Bad command-line arguments, or command-line arguments pointing to
363 an invalid context (e.g. file not following the expected format).
364
365 5 Not found. You requested something (package, version, repository,
366 etc.) that couldn't be found.
367
368 10 Aborted. The operation required confirmation, which wasn't given.
369
370 15 Could not acquire the locks required for the operation.
371
372 20 There is no solution to the user request. This can be caused by
373 asking to install two incompatible packages, for example.
374
375 30 Error in package definition, or other metadata files. Using
376 --strict raises this error more often.
377
378 31 Package script error. Some package operations were unsuccessful.
379 This may be an error in the packages or an incompatibility with
380 your system. This can be a partial error.
381
382 40 Sync error. Could not fetch some remotes from the network. This can
383 be a partial error.
384
385 50 Configuration error. Opam or system configuration doesn't allow
386 operation, and needs fixing.
387
388 60 Solver failure. The solver failed to return a sound answer. It can
389 be due to a broken external solver, or an error in solver
390 configuration.
391
392 99 Internal error. Something went wrong, likely due to a bug in opam
393 itself.
394
395 130 User interrupt. SIGINT was received, generally due to the user
396 pressing Ctrl-C.
397
399 See https://opam.ocaml.org/doc.
400
402 Vincent Bernardoff <vb@luminar.eu.org>
403 Raja Boujbel <raja.boujbel@ocamlpro.com>
404 Roberto Di Cosmo <roberto@dicosmo.org>
405 Thomas Gazagnaire <thomas@gazagnaire.org>
406
407 Louis Gesbert <louis.gesbert@ocamlpro.com>
408 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
409 Anil Madhavapeddy <anil@recoil.org>
410 Guillem Rieu <guillem.rieu@ocamlpro.com>
411 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
412 Frederic Tuong <tuong@users.gforge.inria.fr>
413
415 Check bug reports at https://github.com/ocaml/opam/issues.
416
417
418
419Opam 2.0.1 opam-upgrade(1)