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

NAME

6       opam-reinstall - Reinstall a list of packages.
7

SYNOPSIS

9       opam reinstall [OPTION]… [PACKAGES]…
10

DESCRIPTION

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

ARGUMENTS

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

OPTIONS

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

PACKAGE BUILD OPTIONS

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

COMMON OPTIONS

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 auto.
190
191       --confirm-level=LEVEL
192           Confirmation level, LEVEL must be one of ask, no, yes or
193           unsafe-yes. Can be specified more than once. If --yes or --no are
194           also given, the value of the last --confirm-level is taken into
195           account. This is equivalent to setting  $OPAMCONFIRMLEVEL`.
196
197       --criteria=CRITERIA
198           Specify user preferences for dependency solving for this run.
199           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
200           on the supported language, and the external solvers available, see
201           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
202           using solver preferences can be found at
203           http://www.dicosmo.org/Articles/usercriteria.pdf.
204
205       --cudf=FILENAME
206           Debug option: Save the CUDF requests sent to the solver to
207           FILENAME-<n>.cudf.
208
209       --debug
210           Print debug message to stderr. This is equivalent to setting
211           $OPAMDEBUG to "true".
212
213       --debug-level=LEVEL
214           Like --debug, but allows specifying the debug level (--debug sets
215           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
216
217       --git-version
218           Print the git version of opam, if set (i.e. you are using a
219           development version), and exit.
220
221       --help[=FMT] (default=auto)
222           Show this help in format FMT. The value FMT must be one of auto,
223           pager, groff or plain. With auto, the format is pager or plain
224           whenever the TERM env var is dumb or undefined.
225
226       --ignore-pin-depends
227           Ignore extra pins required by packages that get pinned, either
228           manually through opam pin or through opam install DIR. This is
229           equivalent to setting IGNOREPINDEPENDS=true.
230
231       --json=FILENAME
232           Save the results of the opam run in a computer-readable file. If
233           the filename contains the character `%', it will be replaced by an
234           index that doesn't overwrite an existing file. Similar to setting
235           the $OPAMJSON variable.
236
237       --no-aspcud
238           Removed in 2.1.
239
240       --no-auto-upgrade
241           When configuring or updating a repository that is written for an
242           earlier opam version (1.2), opam internally converts it to the
243           current format. This disables this behaviour. Note that
244           repositories should define their format version in a 'repo' file at
245           their root, or they will be assumed to be in the older format. It
246           is, in any case, preferable to upgrade the repositories manually
247           using opam admin upgrade [--mirror URL] when possible.
248
249       --no-self-upgrade
250           Opam will replace itself with a newer binary found at OPAMROOT/opam
251           if present. This disables this behaviour.
252
253       -q, --quiet
254           Disables --verbose.
255
256       --root=ROOT
257           Use ROOT as the current root path. This is equivalent to setting
258           $OPAMROOT to ROOT.
259
260       --safe, --readonly
261           Make sure nothing will be automatically updated or rewritten.
262           Useful for calling from completion scripts, for example. Will fail
263           whenever such an operation is needed ; also avoids waiting for
264           locks, skips interactive questions and overrides the $OPAMDEBUG
265           variable. This is equivalent to set environment variable $OPAMSAFE.
266
267       --solver=CMD
268           Specify the CUDF solver to use for resolving package installation
269           problems. This is either a predefined solver (this version of opam
270           supports builtin-mccs+lp(), builtin-mccs+glpk,
271           builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
272           mccs, aspcud-old, packup), or a custom command that should contain
273           the variables %{input}%, %{output}%, %{criteria}%, and optionally
274           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
275
276       --strict
277           Fail whenever an error is found in a package definition or a
278           configuration file. The default is to continue silently if
279           possible.
280
281       --switch=SWITCH
282           Use SWITCH as the current compiler switch. This is equivalent to
283           setting $OPAMSWITCH to SWITCH.
284
285       --use-internal-solver
286           Disable any external solver, and use the built-in one (this
287           requires that opam has been compiled with a built-in solver). This
288           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
289
290       -v, --verbose
291           Be more verbose. One -v shows all package commands, repeat to also
292           display commands called internally (e.g. tar, curl, patch etc.)
293           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
294
295       --version
296           Show version information.
297
298       -w, --working-dir
299           Whenever updating packages that are bound to a local,
300           version-controlled directory, update to the current working state
301           of their source instead of the last committed state, or the ref
302           they are pointing to. As source directory is copied as it is, if it
303           isn't clean it may result on a opam build failure.This only affects
304           packages explicitly listed on the command-line.It can also be set
305           with $OPAMWORKINGDIR.
306

ENVIRONMENT

308       Opam makes use of the environment variables listed here. Boolean
309       variables should be set to "0", "no", "false" or the empty string to
310       disable, "1", "yes" or "true" to enable.
311
312       OPAMALLPARENS surround all filters with parenthesis.
313
314       OPAMASSUMEDEPEXTS see option `--assume-depexts'.
315
316       OPAMAUTOREMOVE see remove option `--auto-remove'.
317
318       OPAMBESTEFFORT see option `--best-effort'.
319
320       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
321       the criteria when the `--best-effort' option is set, and is expected to
322       maximise the `opam-query' property in the solution.
323
324       OPAMBUILDDOC Removed in 2.1.
325
326       OPAMBUILDTEST Removed in 2.1.
327
328       OPAMCLI see option `--cli'.
329
330       OPAMCOLOR when set to always or never, sets a default value for the
331       `--color' option.
332
333       OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
334       priority over OPAMYES and OPAMNO.
335
336       OPAMCRITERIA specifies user preferences for dependency solving. The
337       default value depends on the solver version, use `config report' to
338       know the current setting. See also option --criteria.
339
340       OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
341
342       OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
343       preprocessing.
344
345       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
346       for more options.
347
348       OPAMDEBUG see options `--debug' and `--debug-level'.
349
350       OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
351       list of sections. Sections can optionally have a specific debug level
352       (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
353       `--debug-level'.
354
355       OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
356       CUDF preprocessing is.
357
358       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
359
360       OPAMDROPWORKINGDIR overrides packages previously updated with
361       --working-dir on update. Without this variable set, opam would keep
362       them unchanged unless explicitly named on the command-line.
363
364       OPAMDRYRUN see option `--dry-run'.
365
366       OPAMEDITOR sets the editor to use for opam file editing, overrides
367       $EDITOR and $VISUAL.
368
369       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
370       fails. 0 to print all.
371
372       OPAMEXTERNALSOLVER see option `--solver'.
373
374       OPAMFAKE see option `--fake'.
375
376       OPAMFETCH specifies how to download files: either `wget', `curl' or a
377       custom command where variables %{url}%, %{out}%, %{retry}%,
378       %{compress}% and %{checksum}% will be replaced. Overrides the
379       'download-command' value from the main config file.
380
381       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
382
383       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
384
385       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
386
387       OPAMINPLACEBUILD see option `--inplace-build'.
388
389       OPAMJOBS sets the maximum number of parallel workers to run.
390
391       OPAMJSON log json output to the given file (use character `%' to index
392       the files).
393
394       OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
395
396       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
397       some backups. This skips some finalisers and may also help to get more
398       reliable backtraces.
399
400       OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
401
402       OPAMLOGS logdir sets log directory, default is a temporary directory in
403       /tmp
404
405       OPAMMAKECMD set the system make command to use.
406
407       OPAMMERGEOUT merge process outputs, stderr on stdout.
408
409       OPAMNO answer no to any question asked, see options `--no` and
410       `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
411       OPAMYES is set.
412
413       OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
414
415       OPAMNOASPCUD Deprecated.
416
417       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
418       in an earlier format to the current one, on 'update' or 'init'.
419
420       OPAMNOCHECKSUMS enables option --no-checksums when available.
421
422       OPAMNODEPEXTS disables system dependencies handling, see option
423       `--no-depexts'.
424
425       OPAMNOENVNOTICE Internal.
426
427       OPAMNOSELFUPGRADE see option `--no-self-upgrade'
428
429       OPAMPINKINDAUTO sets whether version control systems should be detected
430       when pinning to a local path. Enabled by default since 1.3.0.
431
432       OPAMPRECISETRACKING fine grain tracking of directories.
433
434       OPAMPREPRO set this to false to disable CUDF preprocessing. Less
435       efficient, but might help debugging solver issue.
436
437       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
438       available (e.g. for `opam install').
439
440       OPAMRETRIES sets the number of tries before failing downloads.
441
442       OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
443
444       OPAMROOT see option `--root'. This is automatically set by `opam env
445       --root=DIR --set-root'.
446
447       OPAMROOTISOK don't complain when running as root.
448
449       OPAMSAFE see option `--safe'.
450
451       OPAMSHOW see option `--show'.
452
453       OPAMSKIPUPDATE see option `--skip-updates'.
454
455       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
456       compatibility testing only.
457
458       OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
459       return a solution when they reach timeout; while the solution remains
460       assured to be consistent, there is no guarantee in this case that it
461       fits the expected optimisation criteria. If `true', opam willcontinue
462       with a warning, if `false' a timeout is an error. Currently only the
463       builtin-z3 backend handles this degraded case.
464
465       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
466       60.0, set to 0 for unlimited. Note that all solvers may not support
467       this option.
468
469       OPAMSTATS display stats at the end of command.
470
471       OPAMSTATUSLINE display a dynamic status line showing what's currently
472       going on on the terminal. (one of one of always, never or auto)
473
474       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
475
476       OPAMSWITCH see option `--switch'. Automatically set by `opam env
477       --switch=SWITCH --set-switch'.
478
479       OPAMUNLOCKBASE see install option `--unlock-base'.
480
481       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
482       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
483       are set. See also option --criteria.
484
485       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
486
487       OPAMUSEOPENSSL force openssl use for hash computing.
488
489       OPAMUTF8 use UTF8 characters in output (one of one of always, never or
490       auto). By default `auto', which is determined from the locale).
491
492       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
493       Implies OPAMUTF8. This is set by default on OSX only.
494
495       OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
496       opam repository update.
497
498       OPAMVERBOSE see option `--verbose'.
499
500       OPAMVERSIONLAGPOWER do not use.
501
502       OPAMWITHDOC see install option `--with-doc'.
503
504       OPAMWITHTEST see install option `--with-test.
505
506       OPAMWORKINGDIR see option `--working-dir'.
507
508       OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
509       priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
510
511       OPAMVAR_var overrides the contents of the variable var when
512       substituting `%{var}%` strings in `opam` files.
513
514       OPAMVAR_package_var overrides the contents of the variable package:var
515       when substituting `%{package:var}%` strings in `opam` files.
516

CLI VERSION

518       All scripts and programmatic invocations of opam should use `--cli' in
519       order to ensure that they work seamlessly with future versions of the
520       opam client. Additionally, blog posts or other documentation can
521       benefit, as it prevents information from becoming stale.
522
523       Although opam only supports roots (~/.opam/) for the current version,
524       it does provide backwards compatibility for its command-line interface.
525
526       Since CLI version support was only added in opam 2.1, use OPAMCLI to
527       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
528       for 2.1 (or later) versions, since an environment variable controlling
529       the parsing of syntax is brittle. To this end, opam displays a warning
530       if OPAMCLI specifies a valid version other than 2.0, and also if
531       `--cli=2.0' is specified.
532
533       The command-line version is selected by using the `--cli' option or the
534       OPAMCLI environment variable. `--cli' may be specified morethan once,
535       where the last instance takes precedence. OPAMCLI is only inspected if
536       `--cli' is not given.
537

EXIT STATUS

539       As an exception to the following, the `exec' command returns 127 if the
540       command was not found or couldn't be executed, and the command's exit
541       value otherwise.
542
543       0   Success, or true for boolean queries.
544
545       1   False. Returned when a boolean return value is expected, e.g. when
546           running with --check, or for queries like opam lint.
547
548       2   Bad command-line arguments, or command-line arguments pointing to
549           an invalid context (e.g. file not following the expected format).
550
551       5   Not found. You requested something (package, version, repository,
552           etc.) that couldn't be found.
553
554       10  Aborted. The operation required confirmation, which wasn't given.
555
556       15  Could not acquire the locks required for the operation.
557
558       20  There is no solution to the user request. This can be caused by
559           asking to install two incompatible packages, for example.
560
561       30  Error in package definition, or other metadata files. Using
562           --strict raises this error more often.
563
564       31  Package script error. Some package operations were unsuccessful.
565           This may be an error in the packages or an incompatibility with
566           your system. This can be a partial error.
567
568       40  Sync error. Could not fetch some remotes from the network. This can
569           be a partial error.
570
571       50  Configuration error. Opam or system configuration doesn't allow
572           operation, and needs fixing.
573
574       60  Solver failure. The solver failed to return a sound answer. It can
575           be due to a broken external solver, or an error in solver
576           configuration.
577
578       99  Internal error. Something went wrong, likely due to a bug in opam
579           itself.
580
581       130 User interrupt. SIGINT was received, generally due to the user
582           pressing Ctrl-C.
583

FURTHER DOCUMENTATION

585       See https://opam.ocaml.org/doc.
586

AUTHORS

588       Vincent Bernardoff <vb@luminar.eu.org>
589       Raja Boujbel <raja.boujbel@ocamlpro.com>
590       Roberto Di Cosmo <roberto@dicosmo.org>
591       Thomas Gazagnaire <thomas@gazagnaire.org>
592       Louis Gesbert <louis.gesbert@ocamlpro.com>
593       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
594       Anil Madhavapeddy <anil@recoil.org>
595       Guillem Rieu <guillem.rieu@ocamlpro.com>
596       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
597       Frederic Tuong <tuong@users.gforge.inria.fr>
598

BUGS

600       Check bug reports at https://github.com/ocaml/opam/issues.
601
602
603
604Opam 2.1.3                                                   OPAM-REINSTALL(1)
Impressum