1OPAM-REINSTALL(1) Opam Manual OPAM-REINSTALL(1)
2
3
4
6 opam-reinstall - Reinstall a list of packages.
7
9 opam reinstall [OPTION]... [PACKAGES]...
10
12 This command removes the given packages and the ones that depend on
13 them, and reinstalls the same versions. Without arguments, assume
14 --pending and reinstall any package with upstream changes.
15
16 If a directory is specified as argument, anything that is pinned to
17 that directory is selected for reinstall.
18
20 PACKAGES
21 List of package names, with an optional version or constraint, e.g
22 `pkg', `pkg.1.0' or `pkg>=0.5' ; or directory names containing
23 package description, with explicit directory (e.g. `./srcdir' or
24 `.')
25
27 --assume-built
28 For use on locally-pinned packages: assume they have already been
29 correctly built, and only run their installation instructions,
30 directly from their source directory. This skips the build
31 instructions and can be useful to install packages that are being
32 worked on. Implies --inplace-build. No locally-pinned packages will
33 be skipped.
34
35 --forget-pending
36 Forget about pending reinstallations of listed packages. This
37 implies making opam assume that your packages were installed with a
38 newer version of their metadata, so only use this if you know what
39 you are doing, and the actual changes you are overriding.
40
41 -j JOBS, --jobs=JOBS
42 Set the maximal number of concurrent jobs to use. The default value
43 is calculated from the number of cores. You can also set it using
44 the $OPAMJOBS environment variable.
45
46 --list-pending
47 List packages that have been changed since installed and are marked
48 for reinstallation
49
50 --no
51 Answer no to all opam yes/no questions without prompting. See also
52 --confirm-level. This is equivalent to setting $OPAMNO to "true".
53
54 --pending
55 Perform pending reinstallations, i.e. reinstallations of packages
56 that have changed since installed
57
58 -y, --yes
59 Answer yes to all opam yes/no questions without prompting. See also
60 --confirm-level. This is equivalent to setting $OPAMYES to "true".
61
63 --assume-depexts
64 Skip the installation step for any missing system packages, and
65 attempt to proceed with compilation of the opam packages anyway. If
66 the installation is successful, opam won't prompt again about these
67 system packages. Only meaningful if external dependency handling is
68 enabled.
69
70 -b, --keep-build-dir
71 Keep the build directories after compiling packages. This is
72 equivalent to setting $OPAMKEEPBUILDDIR to "true".
73
74 --build-doc
75 Removed in 2.1, use --with-doc instead.
76
77 --build-test
78 Removed in 2.1, use --with-test instead.
79
80 -d, --with-doc
81 Build the package documentation. This only affects packages listed
82 on the command-line. This is equivalent to setting $OPAMWITHDOC (or
83 the deprecated $OPAMBUILDDOC) to "true".
84
85 --dry-run
86 Simulate the command, but don't actually perform any changes. This
87 also can be set with environment variable $OPAMDEBUG.
88
89 --fake
90 This option registers the actions into the opam database, without
91 actually performing them. WARNING: This option is dangerous and
92 likely to break your opam environment. You probably want --dry-run.
93 You've been warned.
94
95 --ignore-constraints-on[=PACKAGES] (default=)
96 Forces opam to ignore version constraints on all dependencies to
97 the listed packages. This can be used to test compatibility, but
98 expect builds to break when using this. Note that version
99 constraints on optional dependencies and conflicts are unaffected.
100 This is equivalent to setting $OPAMIGNORECONSTRAINTS.
101
102 --inplace-build
103 When compiling a package which has its source bound to a local
104 directory, process the build and install actions directly in that
105 directory, rather than in a clean copy handled by opam. This only
106 affects packages that are explicitly listed on the command-line.
107 This is equivalent to setting $OPAMINPLACEBUILD to "true".
108
109 --lock-suffix=SUFFIX (absent=locked)
110 Set locked files suffix to SUFFIX.
111
112 --locked
113 In commands that use opam files found from pinned sources, if a
114 variant of the file with an added .locked extension is found (e.g.
115 foo.opam.locked besides foo.opam), that will be used instead. This
116 is typically useful to offer a more specific set of dependencies
117 and reproduce similar build contexts, hence the name. The
118 lockoption can be used to generate such files, based on the
119 versions of the dependencies currently installed on the host. This
120 is equivalent to setting the $OPAMLOCKED environment variable. Note
121 that this option doesn't generally affect already pinned packages.
122
123 -m MAKE, --make=MAKE
124 Removed in 2.1, use opam config set[-global] make MAKE instead.
125
126 --no-checksums
127 Do not verify the checksum of downloaded archives.This is
128 equivalent to setting $OPAMNOCHECKSUMS to "true".
129
130 --no-depexts
131 Temporarily disables handling of external dependencies. This can be
132 used if a package is not available on your system package manager,
133 but you installed the required dependency by hand. Implies
134 --assume-depexts, and stores the exceptions upon success as well.
135
136 --require-checksums
137 Reject the installation of packages that don't provide a checksum
138 for the upstream archives. This is equivalent to setting
139 $OPAMREQUIRECHECKSUMS to "true".
140
141 --reuse-build-dir
142 Reuse existing build directories (kept by using --keep-build-dir),
143 instead of compiling from a fresh clone of the source. This can be
144 faster, but also lead to failures if the build systems of the
145 packages don't handle upgrades of dependencies well. This is
146 equivalent to setting $OPAMREUSEBUILDDIR to "true".
147
148 --show-actions
149 Call the solver and display the actions. Don't perform any changes.
150 This is equivalent to setting $OPAMSHOW.
151
152 --skip-updates
153 When running an install, upgrade or reinstall on source-pinned
154 packages, they are normally updated from their origin first. This
155 flag disables that behaviour and will keep them to their version in
156 cache. This is equivalent to setting $OPAMSKIPUPDATE.
157
158 -t, --with-test
159 Build and run the package unit-tests. This only affects packages
160 listed on the command-line. This is equivalent to setting
161 $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
162
163 --unlock-base
164 Removed in 2.1, use --update-invariant instead.
165
166 --update-invariant
167 Allow changes to the packages set as switch base (typically, the
168 main compiler). Use with caution. This is equivalent to setting the
169 $OPAMUNLOCKBASE environment variable
170
172 These options are common to all commands.
173
174 --best-effort
175 Don't fail if all requested packages can't be installed: try to
176 install as many as possible. Note that not all external solvers may
177 support this option (recent versions of aspcud or mccs should).
178 This is equivalent to setting $OPAMBESTEFFORT environment variable.
179
180 --cli=MAJOR.MINOR (absent=2.1)
181 Use the command-line interface syntax and semantics of MAJOR.MINOR.
182 Intended for any persistent use of opam (scripts, blog posts,
183 etc.), any version of opam in the same MAJOR series will behave as
184 for the specified MINOR release. The flag was not available in opam
185 2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable
186 to 2.0 instead of using this parameter.
187
188 --color=WHEN
189 Colorize the output. WHEN must be one of `always', `never' or
190 `auto'.
191
192 --confirm-level=LEVEL
193 Confirmation level, LEVEL must be one of `ask', `no', `yes' or
194 `unsafe-yes'. Can be specified more than once. If --yes or --no are
195 also given, the value of the last --confirm-level is taken into
196 account. This is equivalent to setting $OPAMCONFIRMLEVEL`.
197
198 --criteria=CRITERIA
199 Specify user preferences for dependency solving for this run.
200 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
201 on the supported language, and the external solvers available, see
202 http://opam.ocaml.org/doc/External_solvers.html. A general guide to
203 using solver preferences can be found at
204 http://www.dicosmo.org/Articles/usercriteria.pdf.
205
206 --cudf=FILENAME
207 Debug option: Save the CUDF requests sent to the solver to
208 FILENAME-<n>.cudf.
209
210 --debug
211 Print debug message to stderr. This is equivalent to setting
212 $OPAMDEBUG to "true".
213
214 --debug-level=LEVEL
215 Like --debug, but allows specifying the debug level (--debug sets
216 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
217
218 --git-version
219 Print the git version of opam, if set (i.e. you are using a
220 development version), and exit.
221
222 --help[=FMT] (default=auto)
223 Show this help in format FMT. The value FMT must be one of `auto',
224 `pager', `groff' or `plain'. With `auto', the format is `pager` or
225 `plain' whenever the TERM env var is `dumb' or undefined.
226
227 --ignore-pin-depends
228 Ignore extra pins required by packages that get pinned, either
229 manually through opam pin or through opam install DIR. This is
230 equivalent to setting IGNOREPINDEPENDS=true.
231
232 --json=FILENAME
233 Save the results of the opam run in a computer-readable file. If
234 the filename contains the character `%', it will be replaced by an
235 index that doesn't overwrite an existing file. Similar to setting
236 the $OPAMJSON variable.
237
238 --no-aspcud
239 Removed in 2.1.
240
241 --no-auto-upgrade
242 When configuring or updating a repository that is written for an
243 earlier opam version (1.2), opam internally converts it to the
244 current format. This disables this behaviour. Note that
245 repositories should define their format version in a 'repo' file at
246 their root, or they will be assumed to be in the older format. It
247 is, in any case, preferable to upgrade the repositories manually
248 using opam admin upgrade [--mirror URL] when possible.
249
250 --no-self-upgrade
251 Opam will replace itself with a newer binary found at OPAMROOT/opam
252 if present. This disables this behaviour.
253
254 -q, --quiet
255 Disables --verbose.
256
257 --root=ROOT
258 Use ROOT as the current root path. This is equivalent to setting
259 $OPAMROOT to ROOT.
260
261 --safe, --readonly
262 Make sure nothing will be automatically updated or rewritten.
263 Useful for calling from completion scripts, for example. Will fail
264 whenever such an operation is needed ; also avoids waiting for
265 locks, skips interactive questions and overrides the $OPAMDEBUG
266 variable. This is equivalent to set environment variable $OPAMSAFE.
267
268 --solver=CMD
269 Specify the CUDF solver to use for resolving package installation
270 problems. This is either a predefined solver (this version of opam
271 supports builtin-mccs+lp(), builtin-mccs+glpk,
272 builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
273 mccs, aspcud-old, packup), or a custom command that should contain
274 the variables %{input}%, %{output}%, %{criteria}%, and optionally
275 %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
276
277 --strict
278 Fail whenever an error is found in a package definition or a
279 configuration file. The default is to continue silently if
280 possible.
281
282 --switch=SWITCH
283 Use SWITCH as the current compiler switch. This is equivalent to
284 setting $OPAMSWITCH to SWITCH.
285
286 --use-internal-solver
287 Disable any external solver, and use the built-in one (this
288 requires that opam has been compiled with a built-in solver). This
289 is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
290
291 -v, --verbose
292 Be more verbose. One -v shows all package commands, repeat to also
293 display commands called internally (e.g. tar, curl, patch etc.)
294 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
295
296 --version
297 Show version information.
298
299 -w, --working-dir
300 Whenever updating packages that are bound to a local,
301 version-controlled directory, update to the current working state
302 of their source instead of the last committed state, or the ref
303 they are pointing to. As source directory is copied as it is, if it
304 isn't clean it may result on a opam build failure.This only affects
305 packages explicitly listed on the command-line.It can also be set
306 with $OPAMWORKINGDIR.
307
309 Opam makes use of the environment variables listed here. Boolean
310 variables should be set to "0", "no", "false" or the empty string to
311 disable, "1", "yes" or "true" to enable.
312
313 OPAMALLPARENS surround all filters with parenthesis.
314
315 OPAMASSUMEDEPEXTS see option `--assume-depexts'.
316
317 OPAMAUTOREMOVE see remove option `--auto-remove'.
318
319 OPAMBESTEFFORT see option `--best-effort'.
320
321 OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
322 the criteria when the `--best-effort' option is set, and is expected to
323 maximise the `opam-query' property in the solution.
324
325 OPAMBUILDDOC Removed in 2.1.
326
327 OPAMBUILDTEST Removed in 2.1.
328
329 OPAMCLI see option `--cli'.
330
331 OPAMCOLOR when set to always or never, sets a default value for the
332 `--color' option.
333
334 OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
335 priority over OPAMYES and OPAMNO.
336
337 OPAMCRITERIA specifies user preferences for dependency solving. The
338 default value depends on the solver version, use `config report' to
339 know the current setting. See also option --criteria.
340
341 OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
342
343 OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
344 preprocessing.
345
346 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
347 for more options.
348
349 OPAMDEBUG see options `--debug' and `--debug-level'.
350
351 OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
352 list of sections. Sections can optionally have a specific debug level
353 (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
354 `--debug-level'.
355
356 OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
357 CUDF preprocessing is.
358
359 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
360
361 OPAMDROPWORKINGDIR overrides packages previously updated with
362 --working-dir on update. Without this variable set, opam would keep
363 them unchanged unless explicitly named on the command-line.
364
365 OPAMDRYRUN see option `--dry-run'.
366
367 OPAMEDITOR sets the editor to use for opam file editing, overrides
368 $EDITOR and $VISUAL.
369
370 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
371 fails. 0 to print all.
372
373 OPAMEXTERNALSOLVER see option `--solver'.
374
375 OPAMFAKE see option `--fake'.
376
377 OPAMFETCH specifies how to download files: either `wget', `curl' or a
378 custom command where variables %{url}%, %{out}%, %{retry}%,
379 %{compress}% and %{checksum}% will be replaced. Overrides the
380 'download-command' value from the main config file.
381
382 OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
383
384 OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
385
386 OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
387
388 OPAMINPLACEBUILD see option `--inplace-build'.
389
390 OPAMJOBS sets the maximum number of parallel workers to run.
391
392 OPAMJSON log json output to the given file (use character `%' to index
393 the files).
394
395 OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
396
397 OPAMKEEPLOGS tells opam to not remove some temporary command logs and
398 some backups. This skips some finalisers and may also help to get more
399 reliable backtraces.
400
401 OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
402
403 OPAMLOGS logdir sets log directory, default is a temporary directory in
404 /tmp
405
406 OPAMMAKECMD set the system make command to use.
407
408 OPAMMERGEOUT merge process outputs, stderr on stdout.
409
410 OPAMNO answer no to any question asked, see options `--no` and
411 `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
412 OPAMYES is set.
413
414 OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
415
416 OPAMNOASPCUD Deprecated.
417
418 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
419 in an earlier format to the current one, on 'update' or 'init'.
420
421 OPAMNOCHECKSUMS enables option --no-checksums when available.
422
423 OPAMNODEPEXTS disables system dependencies handling, see option
424 `--no-depexts'.
425
426 OPAMNOENVNOTICE Internal.
427
428 OPAMNOSELFUPGRADE see option `--no-self-upgrade'
429
430 OPAMPINKINDAUTO sets whether version control systems should be detected
431 when pinning to a local path. Enabled by default since 1.3.0.
432
433 OPAMPRECISETRACKING fine grain tracking of directories.
434
435 OPAMPREPRO set this to false to disable CUDF preprocessing. Less
436 efficient, but might help debugging solver issue.
437
438 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
439 available (e.g. for `opam install').
440
441 OPAMRETRIES sets the number of tries before failing downloads.
442
443 OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
444
445 OPAMROOT see option `--root'. This is automatically set by `opam env
446 --root=DIR --set-root'.
447
448 OPAMROOTISOK don't complain when running as root.
449
450 OPAMSAFE see option `--safe'.
451
452 OPAMSHOW see option `--show'.
453
454 OPAMSKIPUPDATE see option `--skip-updates'.
455
456 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
457 compatibility testing only.
458
459 OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
460 return a solution when they reach timeout; while the solution remains
461 assured to be consistent, there is no guarantee in this case that it
462 fits the expected optimisation criteria. If `true', opam willcontinue
463 with a warning, if `false' a timeout is an error. Currently only the
464 builtin-z3 backend handles this degraded case.
465
466 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
467 60.0, set to 0 for unlimited. Note that all solvers may not support
468 this option.
469
470 OPAMSTATS display stats at the end of command.
471
472 OPAMSTATUSLINE display a dynamic status line showing what's currently
473 going on on the terminal. (one of one of `always', `never' or `auto')
474
475 OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
476
477 OPAMSWITCH see option `--switch'. Automatically set by `opam env
478 --switch=SWITCH --set-switch'.
479
480 OPAMUNLOCKBASE see install option `--unlock-base'.
481
482 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
483 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
484 are set. See also option --criteria.
485
486 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
487
488 OPAMUSEOPENSSL force openssl use for hash computing.
489
490 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
491 or `auto'). By default `auto', which is determined from the locale).
492
493 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
494 Implies OPAMUTF8. This is set by default on OSX only.
495
496 OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
497 opam repository update.
498
499 OPAMVERBOSE see option `--verbose'.
500
501 OPAMVERSIONLAGPOWER do not use.
502
503 OPAMWITHDOC see install option `--with-doc'.
504
505 OPAMWITHTEST see install option `--with-test.
506
507 OPAMWORKINGDIR see option `--working-dir'.
508
509 OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
510 priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
511
512 OPAMVAR_var overrides the contents of the variable var when
513 substituting `%{var}%` strings in `opam` files.
514
515 OPAMVAR_package_var overrides the contents of the variable package:var
516 when substituting `%{package:var}%` strings in `opam` files.
517
519 All scripts and programmatic invocations of opam should use `--cli' in
520 order to ensure that they work seamlessly with future versions of the
521 opam client. Additionally, blog posts or other documentation can
522 benefit, as it prevents information from becoming stale.
523
524 Although opam only supports roots (~/.opam/) for the current version,
525 it does provide backwards compatibility for its command-line interface.
526
527 Since CLI version support was only added in opam 2.1, use OPAMCLI to
528 select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
529 for 2.1 (or later) versions, since an environment variable controlling
530 the parsing of syntax is brittle. To this end, opam displays a warning
531 if OPAMCLI specifies a valid version other than 2.0, and also if
532 `--cli=2.0' is specified.
533
534 The command-line version is selected by using the `--cli' option or the
535 OPAMCLI environment variable. `--cli' may be specified morethan once,
536 where the last instance takes precedence. OPAMCLI is only inspected if
537 `--cli' is not given.
538
540 As an exception to the following, the `exec' command returns 127 if the
541 command was not found or couldn't be executed, and the command's exit
542 value otherwise.
543
544 0 Success, or true for boolean queries.
545
546 1 False. Returned when a boolean return value is expected, e.g. when
547 running with --check, or for queries like opam lint.
548
549 2 Bad command-line arguments, or command-line arguments pointing to
550 an invalid context (e.g. file not following the expected format).
551
552 5 Not found. You requested something (package, version, repository,
553 etc.) that couldn't be found.
554
555 10 Aborted. The operation required confirmation, which wasn't given.
556
557 15 Could not acquire the locks required for the operation.
558
559 20 There is no solution to the user request. This can be caused by
560 asking to install two incompatible packages, for example.
561
562 30 Error in package definition, or other metadata files. Using
563 --strict raises this error more often.
564
565 31 Package script error. Some package operations were unsuccessful.
566 This may be an error in the packages or an incompatibility with
567 your system. This can be a partial error.
568
569 40 Sync error. Could not fetch some remotes from the network. This can
570 be a partial error.
571
572 50 Configuration error. Opam or system configuration doesn't allow
573 operation, and needs fixing.
574
575 60 Solver failure. The solver failed to return a sound answer. It can
576 be due to a broken external solver, or an error in solver
577 configuration.
578
579 99 Internal error. Something went wrong, likely due to a bug in opam
580 itself.
581
582 130 User interrupt. SIGINT was received, generally due to the user
583 pressing Ctrl-C.
584
586 See https://opam.ocaml.org/doc.
587
589 Vincent Bernardoff <vb@luminar.eu.org>
590 Raja Boujbel <raja.boujbel@ocamlpro.com>
591 Roberto Di Cosmo <roberto@dicosmo.org>
592 Thomas Gazagnaire <thomas@gazagnaire.org>
593 Louis Gesbert <louis.gesbert@ocamlpro.com>
594 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
595 Anil Madhavapeddy <anil@recoil.org>
596 Guillem Rieu <guillem.rieu@ocamlpro.com>
597 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
598 Frederic Tuong <tuong@users.gforge.inria.fr>
599
601 Check bug reports at https://github.com/ocaml/opam/issues.
602
603
604
605Opam 2.1.2 OPAM-REINSTALL(1)