1opam-list(1)                      Opam Manual                     opam-list(1)
2
3
4

NAME

6       opam-list - Display the list of available packages.
7

SYNOPSIS

9       opam list [OPTION]... [PATTERNS]...
10

DESCRIPTION

12       List selections of opam packages.
13
14       Without argument, the command displays the list of currently installed
15       packages. With pattern arguments, lists all available packages matching
16       one of the patterns.
17
18       Unless the --short switch is used, the output format displays one
19       package per line, and each line contains the name of the package, the
20       installed version or `--' if the package is not installed, and a short
21       description. In color mode, manually installed packages (as opposed to
22       automatically installed ones because of dependencies) are underlined.
23
24       See section PACKAGE SELECTION OPTIONS for all the ways to select the
25       packages to be displayed, and section OUTPUT FORMAT OPTIONS to
26       customise the output format.
27
28       For a more detailed description of packages, see opam show. For
29       extended search capabilities within the packages' metadata, see opam
30       search.
31

ARGUMENTS

33       PATTERNS
34           Package patterns with globs. Unless --search is specified, they
35           match againsta NAME or NAME.VERSION
36

PACKAGE SELECTION OPTIONS

38       -A, --all
39           Include all, even uninstalled or unavailable packages
40
41       -a, --available
42           List only packages that are available on the current system
43
44       --base
45           List only the immutable base of the current switch (i.e. compiler
46           packages)
47
48       --coinstallable-with=PACKAGES
49           Only list packages that are compatible with all of PACKAGES.
50
51       --conflicts-with=PACKAGES
52           List packages that have declared conflicts with at least one of the
53           given list. This includes conflicts defined from the packages in
54           the list, from the other package, or by a common conflict-class:
55           field.
56
57       --depends-on=PACKAGES
58           List only packages that depend on one of (comma-separated)
59           PACKAGES.
60
61       --depopts
62           Include optional dependencies in dependency requests.
63
64       --dev
65           Include development packages in dependencies.
66
67       --field-match=FIELD:PATTERN
68           Filter packages with a match for PATTERN on the given FIELD
69
70       --has-flag=FLAG
71           Only include packages which have the given flag set. Package flags
72           are one of: light-uninstall verbose plugin compiler conf
73
74       --has-tag=TAG
75           Only includes packages which have the given tag set
76
77       -i, --installed
78           List installed packages only. This is the default when no further
79           arguments are supplied
80
81       --installable
82           List only packages that can be installed on the current switch
83           (this calls the solver and may be more costly; a package depending
84           on an unavailable package may be available, but is never
85           installable)
86
87       --no-switch
88           List what is available from the repositories, without consideration
89           for the current (or any other) switch (installed or pinned
90           packages, etc.)
91
92       --nobuild
93           Exclude build dependencies (they are included by default).
94
95       --or
96           Instead of selecting packages that match all the criteria, select
97           packages that match any of them
98
99       --owns-file=FILE
100           Finds installed packages responsible for installing the given file
101
102       --pinned
103           List only the pinned packages
104
105       --post
106           Include dependencies tagged as post.
107
108       --recursive
109           With `--depends-on' and `--required-by', display all transitive
110           dependencies rather than just direct dependencies.
111
112       --repos=REPOS
113           Include only packages that took their origin from one of the given
114           repositories (unless no-switch is also specified, this excludes
115           pinned packages).
116
117       --required-by=PACKAGES
118           List only the dependencies of (comma-separated) PACKAGES.
119
120       --resolve=PACKAGES
121           Restrict to a solution to install (comma-separated) PACKAGES, i.e.
122           a consistent set of packages including those. This is subtly
123           different from `--required-by --recursive`, which is more
124           predictable and can't fail, but lists all dependencies
125           independently without ensuring consistency. Without `--installed`,
126           the answer is self-contained and independent of the current
127           installation. With `--installed', it's computed from the set of
128           currently installed packages. `--no-switch` further makes the
129           solution independent from the currently pinned packages,
130           architecture, and compiler version. The combination with
131           `--depopts' is not supported.
132
133       --roots, --installed-roots
134           List only packages that were explicitly installed, excluding the
135           ones installed as dependencies
136
137       --search
138           Match PATTERNS against the full descriptions of packages, and
139           require all of them to match, instead of requiring at least one to
140           match against package names (unless --or is also specified).
141
142       -t, --with-test, --test
143           Include test-only dependencies.
144
145       --with-doc, --doc
146           Include doc-only dependencies.
147

OUTPUT FORMAT OPTIONS

149       --columns=COLUMNS
150           Select the columns to display among: name, version, package,
151           synopsis, synopsis-or-target, description, <field>:,
152           installed-version, pin, source-hash, opam-file,
153           all-installed-versions, available-versions, all-versions,
154           repository, installed-files, vc-ref, depexts. The default is name
155           when --short is present and name, installed-version,
156           synopsis-or-target otherwise.
157
158       -e, --external, --depexts
159           Instead of displaying the packages, display their external
160           dependencies that are associated with the current system. This
161           excludes other display options. Rather than using this directly,
162           you should probably head for the `depext' plugin, that will use
163           your system package management system to handle the installation of
164           the dependencies. Run `opam depext'.
165
166       --normalise
167           Print the values of opam fields normalised
168
169       -S, --sort
170           Sort the packages in dependency order (i.e. an order in which they
171           could be individually installed.)
172
173       -s, --short
174           Don't print a header, and sets the default columns to name only. If
175           you need package versions included, use --columns=package instead
176
177       --separator=STRING (absent= )
178           Set the column-separator string
179
180       -V, --all-versions
181           Normally, when multiple versions of a package match, only one is
182           shown in the output (the installed one, the pinned-to one, or,
183           failing that, the highest one available or the highest one). This
184           flag disables this behaviour and shows all matching versions. This
185           also changes the default display format to include package versions
186           instead of just package names (including when --short is set). This
187           is automatically turned on when a single non-pattern package name
188           is provided on the command-line.
189
190       --vars=[VAR=STR,...]
191           Define the given variable bindings. Typically useful with
192           --external to override the values for arch, os, os-distribution,
193           os-version, os-family.
194
195       --wrap
196           Wrap long lines, the default being to truncate when displaying on a
197           terminal, or to keep as is otherwise
198

OPTIONS

200       --silent
201           Don't write anything in the output, exit with return code 0 if the
202           list is not empty, 1 otherwise.
203

COMMON OPTIONS

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

ENVIRONMENT VARIABLES

324       Opam makes use of the environment variables listed here. Boolean
325       variables should be set to "0", "no", "false" or the empty string to
326       disable, "1", "yes" or "true" to enable.
327
328       OPAMCOLOR, when set to always or never, sets a default value for the
329       --color option.
330
331       OPAMCRITERIA specifies user preferences for dependency solving. The
332       default value depends on the solver version, use `config report` to
333       know the current setting. See also option --criteria
334
335       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
336       for more options.
337
338       OPAMDEBUG see options `--debug' and `--debug-level'.
339
340       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
341
342       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
343       fails. 0 to print all.
344
345       OPAMEXTERNALSOLVER see option `--solver'.
346
347       OPAMFETCH specifies how to download files: either `wget', `curl' or a
348       custom command where variables %{url}%, %{out}%, %{retry}%,
349       %{compress}% and %{checksum}% will be replaced. Overrides the
350       'download-command' value from the main config file.
351
352       OPAMJOBS sets the maximum number of parallel workers to run.
353
354       OPAMJSON log json output to the given file (use character `%' to index
355       the files)
356
357       OPAMLOCK see option `--lock'.
358
359       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
360       in an earlier format to the current one, on 'update' or 'init'.
361
362       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
363       some backups. This skips some finalisers and may also help to get more
364       reliable backtraces
365
366       OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
367       acquiring its lock and fails. <= 0 means infinite wait.
368
369       OPAMNO answer no to any question asked.
370
371       OPAMNOASPCUD see option `--no-aspcud'.
372
373       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
374
375       OPAMPINKINDAUTO sets whether version control systems should be detected
376       when pinning to a local path. Enabled by default since 1.3.0.
377
378       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
379       available (e.g. for `opam install`).
380
381       OPAMRETRY sets the number of tries before failing downloads.
382
383       OPAMROOT see option `--root'. This is automatically set by `opam env
384       --root=DIR --set-root'.
385
386       OPAMROOTISOK don't complain when running as root.
387
388       OPAMSAFE see option `--safe'
389
390       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
391       compatibility testing only.
392
393       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
394       60.0, set to 0 for unlimited. Note that all solvers may not support
395       this option.
396
397       OPAMSTATUSLINE display a dynamic status line showing what's currently
398       going on on the terminal. (one of one of `always', `never' or `auto')
399
400       OPAMSWITCH see option `--switch'. Automatically set by `opam env
401       --switch=SWITCH --set-switch'.
402
403       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
404       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
405       are set. See also option --criteria
406
407       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
408
409       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
410       or `auto'). By default `auto', which is determined from the locale).
411
412       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
413       Implies OPAMUTF8. This is set by default on OSX only.
414
415       OPAMVAR_var overrides the contents of the variable var when
416       substituting `%{var}%` strings in `opam` files.
417
418       OPAMVAR_package_var overrides the contents of the variable package:var
419       when substituting `%{package:var}%` strings in `opam` files.
420
421       OPAMVERBOSE see option `--verbose'.
422
423       OPAMYES see option `--yes'.
424

EXIT STATUS

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

FURTHER DOCUMENTATION

472       See https://opam.ocaml.org/doc.
473

AUTHORS

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

BUGS

487       Check bug reports at https://github.com/ocaml/opam/issues.
488
489
490
491Opam 2.0.1                                                        opam-list(1)
Impressum