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

COMMON OPTIONS

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

ENVIRONMENT VARIABLES

257       Opam makes use of the environment variables listed here. Boolean
258       variables should be set to "0", "no", "false" or the empty string to
259       disable, "1", "yes" or "true" to enable.
260
261       OPAMCOLOR, when set to always or never, sets a default value for the
262       --color option.
263
264       OPAMCRITERIA specifies user preferences for dependency solving. The
265       default value depends on the solver version, use `config report` to
266       know the current setting. See also option --criteria
267
268       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
269       for more options.
270
271       OPAMDEBUG see options `--debug' and `--debug-level'.
272
273       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
274
275       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
276       fails. 0 to print all.
277
278       OPAMEXTERNALSOLVER see option `--solver'.
279
280       OPAMFETCH specifies how to download files: either `wget', `curl' or a
281       custom command where variables %{url}%, %{out}%, %{retry}%,
282       %{compress}% and %{checksum}% will be replaced. Overrides the
283       'download-command' value from the main config file.
284
285       OPAMJOBS sets the maximum number of parallel workers to run.
286
287       OPAMJSON log json output to the given file (use character `%' to index
288       the files)
289
290       OPAMLOCK see option `--lock'.
291
292       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
293       in an earlier format to the current one, on 'update' or 'init'.
294
295       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
296       some backups. This skips some finalisers and may also help to get more
297       reliable backtraces
298
299       OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
300       acquiring its lock and fails. <= 0 means infinite wait.
301
302       OPAMNO answer no to any question asked.
303
304       OPAMNOASPCUD see option `--no-aspcud'.
305
306       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
307
308       OPAMPINKINDAUTO sets whether version control systems should be detected
309       when pinning to a local path. Enabled by default since 1.3.0.
310
311       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
312       available (e.g. for `opam install`).
313
314       OPAMRETRY sets the number of tries before failing downloads.
315
316       OPAMROOT see option `--root'. This is automatically set by `opam env
317       --root=DIR --set-root'.
318
319       OPAMROOTISOK don't complain when running as root.
320
321       OPAMSAFE see option `--safe'
322
323       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
324       compatibility testing only.
325
326       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
327       60.0, set to 0 for unlimited. Note that all solvers may not support
328       this option.
329
330       OPAMSTATUSLINE display a dynamic status line showing what's currently
331       going on on the terminal. (one of one of `always', `never' or `auto')
332
333       OPAMSWITCH see option `--switch'. Automatically set by `opam env
334       --switch=SWITCH --set-switch'.
335
336       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
337       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
338       are set. See also option --criteria
339
340       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
341
342       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
343       or `auto'). By default `auto', which is determined from the locale).
344
345       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
346       Implies OPAMUTF8. This is set by default on OSX only.
347
348       OPAMVAR_var overrides the contents of the variable var when
349       substituting `%{var}%` strings in `opam` files.
350
351       OPAMVAR_package_var overrides the contents of the variable package:var
352       when substituting `%{package:var}%` strings in `opam` files.
353
354       OPAMVERBOSE see option `--verbose'.
355
356       OPAMYES see option `--yes'.
357

EXIT STATUS

359       As an exception to the following, the `exec' command returns 127 if the
360       command was not found or couldn't be executed, and the command's exit
361       value otherwise.
362
363       0   Success, or true for boolean queries.
364
365       1   False. Returned when a boolean return value is expected, e.g. when
366           running with --check, or for queries like opam lint.
367
368       2   Bad command-line arguments, or command-line arguments pointing to
369           an invalid context (e.g. file not following the expected format).
370
371       5   Not found. You requested something (package, version, repository,
372           etc.) that couldn't be found.
373
374       10  Aborted. The operation required confirmation, which wasn't given.
375
376       15  Could not acquire the locks required for the operation.
377
378       20  There is no solution to the user request. This can be caused by
379           asking to install two incompatible packages, for example.
380
381       30  Error in package definition, or other metadata files. Using
382           --strict raises this error more often.
383
384       31  Package script error. Some package operations were unsuccessful.
385           This may be an error in the packages or an incompatibility with
386           your system. This can be a partial error.
387
388       40  Sync error. Could not fetch some remotes from the network. This can
389           be a partial error.
390
391       50  Configuration error. Opam or system configuration doesn't allow
392           operation, and needs fixing.
393
394       60  Solver failure. The solver failed to return a sound answer. It can
395           be due to a broken external solver, or an error in solver
396           configuration.
397
398       99  Internal error. Something went wrong, likely due to a bug in opam
399           itself.
400
401       130 User interrupt. SIGINT was received, generally due to the user
402           pressing Ctrl-C.
403

FURTHER DOCUMENTATION

405       See https://opam.ocaml.org/doc.
406

AUTHORS

408       Vincent Bernardoff <vb@luminar.eu.org>
409       Raja Boujbel <raja.boujbel@ocamlpro.com>
410       Roberto Di Cosmo <roberto@dicosmo.org>
411       Thomas Gazagnaire <thomas@gazagnaire.org>
412       Louis Gesbert <louis.gesbert@ocamlpro.com>
413       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
414       Anil Madhavapeddy <anil@recoil.org>
415       Guillem Rieu <guillem.rieu@ocamlpro.com>
416       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
417       Frederic Tuong <tuong@users.gforge.inria.fr>
418

BUGS

420       Check bug reports at https://github.com/ocaml/opam/issues.
421
422
423
424Opam 2.0.1                                                      opam-remove(1)
Impressum