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

NAME

6       opam-remove - Remove a list of packages.
7

SYNOPSIS

9       opam remove [OPTION]... [PACKAGES]...
10

DESCRIPTION

12       This command uninstalls one or more packages currently installed in the
13       currently selected compiler switch. To remove packages installed in
14       another compiler, you need to switch compilers using opam switch or use
15       the --switch flag. This command is the inverse of opam-install.
16
17       If a directory name is specified as package, packages pinned to that
18       directory are both unpinned and removed.
19

ARGUMENTS

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

OPTIONS

28       -a, --auto-remove
29           Remove all the packages which have not been explicitly installed
30           and which are not necessary anymore. It is possible to prevent the
31           removal of an already-installed package by running opam install
32           <pkg> --set-root. This flag can also be set using the
33           $OPAMAUTOREMOVE configuration variable.
34
35       --destdir=DIR
36           Instead of uninstalling the packages, reverts the action of opam
37           install --destdir: remove files corresponding to what the listed
38           packages installed to the current switch from the given DIR. Note
39           that the package needs to still be installed to the same version
40           that was used for install --destdir for this to work reliably. The
41           packages are not removed from the current opam switch when this is
42           specified.
43
44       --force
45           Execute the remove commands of given packages directly, even if
46           they are not considered installed by opam.
47
48       -j JOBS, --jobs=JOBS
49           Set the maximal number of concurrent jobs to use. The default value
50           is calculated from the number of cores. You can also set it using
51           the $OPAMJOBS environment variable.
52

PACKAGE BUILD OPTIONS

54       -b, --keep-build-dir
55           Keep the build directories after compiling packages. This is
56           equivalent to setting $OPAMKEEPBUILDDIR to "true".
57
58       -d, --with-doc, --build-doc
59           Build the package documentation. This only affects packages listed
60           on the command-line. The --build-doc form is deprecated as this
61           does also installation. This is equivalent to setting $OPAMWITHDOC
62           (or the deprecated $OPAMBUILDDOC) to "true".
63
64       --dry-run
65           Simulate the command, but don't actually perform any changes. This
66           also can be set with environment variable $OPAMDEBUG.
67
68       --fake
69           This option registers the actions into the opam database, without
70           actually performing them. WARNING: This option is dangerous and
71           likely to break your opam environment. You probably want
72           `--dry-run'. You've been warned.
73
74       --ignore-constraints-on[=PACKAGES] (default=)
75           Forces opam to ignore version constraints on all dependencies to
76           the listed packages. This can be used to test compatibility, but
77           expect builds to break when using this. Note that version
78           constraints on optional dependencies and conflicts are unaffected.
79           This is equivalent to setting $OPAMIGNORECONSTRAINTS.
80
81       --inplace-build
82           When compiling a package which has its source bound to a local
83           directory, process the build and install actions directly in that
84           directory, rather than in a clean copy handled by opam. This only
85           affects packages that are explicitly listed on the command-line.
86           This is equivalent to setting $OPAMINPLACEBUILD to "true".
87
88       --locked[=SUFFIX] (default=locked)
89           In commands that use opam files found from pinned sources, if a
90           variant of the file with an added .SUFFIX extension is found (e.g.
91           foo.opam.locked besides foo.opam), that will be used instead. This
92           is typically useful to offer a more specific set of dependencies
93           and reproduce similar build contexts, hence the name. The opam lock
94           plugin can be used to generate such files, based on the versions of
95           the dependencies currently installed on the host. This is
96           equivalent to setting the $OPAMLOCKED environment variable. Note
97           that this option doesn't generally affect already pinned packages.
98
99       -m MAKE, --make=MAKE
100           Use MAKE as the default 'make' command. Deprecated: use opam config
101           set[-global] make MAKE instead. Has no effect if the make variable
102           is defined.
103
104       --no-checksums
105           Do not verify the checksum of downloaded archives.This is
106           equivalent to setting $OPAMNOCHECKSUMS to "true".
107
108       --require-checksums
109           Reject the installation of packages that don't provide a checksum
110           for the upstream archives. This is equivalent to setting
111           $OPAMREQUIRECHECKSUMS to "true".
112
113       --reuse-build-dir
114           Reuse existing build directories (kept by using --keep-build-dir),
115           instead of compiling from a fresh clone of the source. This can be
116           faster, but also lead to failures if the build systems of the
117           packages don't handle upgrades of dependencies well. This is
118           equivalent to setting $OPAMREUSEBUILDDIR to "true".
119
120       --show-actions
121           Call the solver and display the actions. Don't perform any changes.
122           This is equivalent to setting $OPAMSHOW.
123
124       --skip-updates
125           When running an install, upgrade or reinstall on source-pinned
126           packages, they are normally updated from their origin first. This
127           flag disables that behaviour and will keep them to their version in
128           cache. This is equivalent to setting $OPAMSKIPUPDATE.
129
130       -t, --with-test, --build-test
131           Build and run the package unit-tests. This only affects packages
132           listed on the command-line. The --build-test form is deprecated as
133           this also affects installation. This is equivalent to setting
134           $OPAMWITHTEST (or the deprecated $OPAMBUILDTEST) to "true".
135
136       --unlock-base
137           Allow changes to the packages set as switch base (typically, the
138           main compiler). Use with caution. This is equivalent to setting the
139           $OPAMUNLOCKBASE environment variable
140

COMMON OPTIONS

142       These options are common to all commands.
143
144       --best-effort
145           Don't fail if all requested packages can't be installed: try to
146           install as many as possible. Note that not all external solvers may
147           support this option (recent versions of aspcud or mccs should).
148           This is equivalent to setting $OPAMBESTEFFORT environment variable.
149
150       --color=WHEN
151           Colorize the output. WHEN must be one of `always', `never' or
152           `auto'.
153
154       --criteria=CRITERIA
155           Specify user preferences for dependency solving for this run.
156           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
157           on the supported language, and the external solvers available, see
158           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
159           using solver preferences can be found at
160           http://www.dicosmo.org/Articles/usercriteria.pdf.
161
162       --cudf=FILENAME
163           Debug option: Save the CUDF requests sent to the solver to
164           FILENAME-<n>.cudf.
165
166       --debug
167           Print debug message to stderr. This is equivalent to setting
168           $OPAMDEBUG to "true".
169
170       --debug-level=LEVEL
171           Like --debug, but allows specifying the debug level (--debug sets
172           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
173
174       --git-version
175           Print the git version of opam, if set (i.e. you are using a
176           development version), and exit.
177
178       --help[=FMT] (default=auto)
179           Show this help in format FMT. The value FMT must be one of `auto',
180           `pager', `groff' or `plain'. With `auto', the format is `pager` or
181           `plain' whenever the TERM env var is `dumb' or undefined.
182
183       --ignore-pin-depends
184           Ignore extra pins required by packages that get pinned, either
185           manually through opam pin or through opam install DIR. This is
186           equivalent to setting IGNOREPINDEPENDS=true.
187
188       --json=FILENAME
189           Save the results of the opam run in a computer-readable file. If
190           the filename contains the character `%', it will be replaced by an
191           index that doesn't overwrite an existing file. Similar to setting
192           the $OPAMJSON variable.
193
194       --no-aspcud
195           Deprecated.
196
197       --no-auto-upgrade
198           When configuring or updating a repository that is written for an
199           earlier opam version (1.2), opam internally converts it to the
200           current format. This disables this behaviour. Note that
201           repositories should define their format version in a 'repo' file at
202           their root, or they will be assumed to be in the older format. It
203           is, in any case, preferable to upgrade the repositories manually
204           using opam admin upgrade [--mirror URL] when possible.
205
206       --no-self-upgrade
207           Opam will replace itself with a newer binary found at OPAMROOT/opam
208           if present. This disables this behaviour.
209
210       -q, --quiet
211           Disables --verbose.
212
213       --root=ROOT
214           Use ROOT as the current root path. This is equivalent to setting
215           $OPAMROOT to ROOT.
216
217       --safe, --readonly
218           Make sure nothing will be automatically updated or rewritten.
219           Useful for calling from completion scripts, for example. Will fail
220           whenever such an operation is needed ; also avoids waiting for
221           locks, skips interactive questions and overrides the $OPAMDEBUG
222           variable. This is equivalent to set environment variable $OPAMSAFE.
223
224       --solver=CMD
225           Specify the CUDF solver to use for resolving package installation
226           problems. This is either a predefined solver (this version of opam
227           supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
228           aspcud-old, packup), or a custom command that should contain the
229           variables %{input}%, %{output}%, %{criteria}%, and optionally
230           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
231
232       --strict
233           Fail whenever an error is found in a package definition or a
234           configuration file. The default is to continue silently if
235           possible.
236
237       --switch=SWITCH
238           Use SWITCH as the current compiler switch. This is equivalent to
239           setting $OPAMSWITCH to SWITCH.
240
241       --use-internal-solver
242           Disable any external solver, and use the built-in one (this
243           requires that opam has been compiled with a built-in solver). This
244           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
245
246       -v, --verbose
247           Be more verbose. One -v shows all package commands, repeat to also
248           display commands called internally (e.g. tar, curl, patch etc.)
249           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
250
251       --version
252           Show version information.
253
254       -w, --working-dir
255           Whenever updating packages that are bound to a local,
256           version-controlled directory, update to the current working state
257           of their source instead of the last committed state, or the ref
258           they are pointing to. This only affects packages explicitly listed
259           on the command-line.It can also be set with $OPAMWORKINGDIR.
260
261       -y, --yes
262           Answer yes to all yes/no questions without prompting. This is
263           equivalent to setting $OPAMYES to "true".
264

ENVIRONMENT VARIABLES

266       Opam makes use of the environment variables listed here. Boolean
267       variables should be set to "0", "no", "false" or the empty string to
268       disable, "1", "yes" or "true" to enable.
269
270       OPAMALLPARENS surround all filters with parenthesis
271
272       OPAMAUTOREMOVE see remove option `--auto-remove`
273
274       OPAMBESTEFFORT see option `--best-effort`
275
276       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
277       the criteria when the `--best-effort` option is set, and is expected to
278       maximise the `opam-query` property in the solution
279
280       OPAMCOLOR, when set to always or never, sets a default value for the
281       --color option.
282
283       OPAMCRITERIA specifies user preferences for dependency solving. The
284       default value depends on the solver version, use `config report` to
285       know the current setting. See also option --criteria
286
287       OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
288
289       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
290       for more options.
291
292       OPAMDEBUG see options `--debug' and `--debug-level'.
293
294       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
295
296       OPAMDRYRUN see option `--dry-run`
297
298       OPAMEDITOR sets the editor to use for opam file editing, overrides
299       $EDITOR and $VISUAL
300
301       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
302       fails. 0 to print all.
303
304       OPAMEXTERNALSOLVER see option `--solver'.
305
306       OPAMFAKE see option `--fake`
307
308       OPAMFETCH specifies how to download files: either `wget', `curl' or a
309       custom command where variables %{url}%, %{out}%, %{retry}%,
310       %{compress}% and %{checksum}% will be replaced. Overrides the
311       'download-command' value from the main config file.
312
313       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
314
315       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
316
317       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
318
319       OPAMJOBS sets the maximum number of parallel workers to run.
320
321       OPAMJSON log json output to the given file (use character `%' to index
322       the files)
323
324       OPAMLOCKED see install option `--locked`
325
326       OPAMLOGS logdir sets log directory, default is a temporary directory in
327       /tmp
328
329       OPAMMAKECMD set the system make command to use
330
331       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
332       in an earlier format to the current one, on 'update' or 'init'.
333
334       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
335       some backups. This skips some finalisers and may also help to get more
336       reliable backtraces
337
338       OPAMLOCKRETRIES sets the number of tries after which opam gives up
339       acquiring its lock and fails. <= 0 means infinite wait.
340
341       OPAMMERGEOUT merge process outputs, stderr on stdout
342
343       OPAMNO answer no to any question asked.
344
345       OPAMNOASPCUD Deprecated.
346
347       OPAMNOCHECKSUMS enables option --no-checksums when available.
348
349       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
350
351       OPAMPINKINDAUTO sets whether version control systems should be detected
352       when pinning to a local path. Enabled by default since 1.3.0.
353
354       OPAMPRECISETRACKING fine grain tracking of directories
355
356       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
357       available (e.g. for `opam install`).
358
359       OPAMRETRES sets the number of tries before failing downloads.
360
361       OPAMROOT see option `--root'. This is automatically set by `opam env
362       --root=DIR --set-root'.
363
364       OPAMROOTISOK don't complain when running as root.
365
366       OPAMSAFE see option `--safe'
367
368       OPAMSHOW see option `--show`
369
370       OPAMSKIPUPDATE see option `--skip-updates`
371
372       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
373       compatibility testing only.
374
375       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
376       60.0, set to 0 for unlimited. Note that all solvers may not support
377       this option.
378
379       OPAMSTATUSLINE display a dynamic status line showing what's currently
380       going on on the terminal. (one of one of `always', `never' or `auto')
381
382       OPAMSTATS display stats at the end of command
383
384       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
385
386       OPAMSWITCH see option `--switch'. Automatically set by `opam env
387       --switch=SWITCH --set-switch'.
388
389       OPAMUNLOCKBASE see install option `--unlock-base`
390
391       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
392       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
393       are set. See also option --criteria
394
395       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
396
397       OPAMUSEOPENSSL force openssl use for hash computing
398
399       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
400       or `auto'). By default `auto', which is determined from the locale).
401
402       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
403       Implies OPAMUTF8. This is set by default on OSX only.
404
405       OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
406       an opam repository update
407
408       OPAMVAR_var overrides the contents of the variable var when
409       substituting `%{var}%` strings in `opam` files.
410
411       OPAMVAR_package_var overrides the contents of the variable package:var
412       when substituting `%{package:var}%` strings in `opam` files.
413
414       OPAMVERBOSE see option `--verbose'.
415
416       OPAMWORKINGDIR see option `--working-dir`
417
418       OPAMYES see option `--yes'.
419

EXIT STATUS

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

FURTHER DOCUMENTATION

467       See https://opam.ocaml.org/doc.
468

AUTHORS

470       Vincent Bernardoff <vb@luminar.eu.org>
471       Raja Boujbel <raja.boujbel@ocamlpro.com>
472
473       Roberto Di Cosmo <roberto@dicosmo.org>
474       Thomas Gazagnaire <thomas@gazagnaire.org>
475       Louis Gesbert <louis.gesbert@ocamlpro.com>
476       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
477       Anil Madhavapeddy <anil@recoil.org>
478       Guillem Rieu <guillem.rieu@ocamlpro.com>
479       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
480       Frederic Tuong <tuong@users.gforge.inria.fr>
481

BUGS

483       Check bug reports at https://github.com/ocaml/opam/issues.
484
485
486
487Opam 2.0.6                                                      OPAM-REMOVE(1)
Impressum