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, --available
39           List only packages that are available on the current system
40
41       -A, --all
42           Include all, even uninstalled or unavailable packages
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       --check
201           Don't write anything in the output, exit with return code 0 if the
202           list is not empty, 1 otherwise.
203
204       --no
205           Answer no to all opam yes/no questions without prompting. See also
206           --confirm-level. This is equivalent to setting $OPAMNO to "true".
207
208       --no-depexts
209           Disable external dependencies handling for the query. This can be
210           used to include packages that are marked as unavailable because of
211           an unavailable system dependency.
212
213       --silent
214           Removed in 2.1, use --check instead.
215
216       -y, --yes
217           Answer yes to all opam yes/no questions without prompting. See also
218           --confirm-level. This is equivalent to setting $OPAMYES to "true".
219

COMMON OPTIONS

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

ENVIRONMENT

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

CLI VERSION

568       All scripts and programmatic invocations of opam should use `--cli' in
569       order to ensure that they work seamlessly with future versions of the
570       opam client. Additionally, blog posts or other documentation can
571       benefit, as it prevents information from becoming stale.
572
573       Although opam only supports roots (~/.opam/) for the current version,
574       it does provide backwards compatibility for its command-line interface.
575
576       Since CLI version support was only added in opam 2.1, use OPAMCLI to
577       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
578       for 2.1 (or later) versions, since an environment variable controlling
579       the parsing of syntax is brittle. To this end, opam displays a warning
580       if OPAMCLI specifies a valid version other than 2.0, and also if
581       `--cli=2.0' is specified.
582
583       The command-line version is selected by using the `--cli' option or the
584       OPAMCLI environment variable. `--cli' may be specified morethan once,
585       where the last instance takes precedence. OPAMCLI is only inspected if
586       `--cli' is not given.
587

EXIT STATUS

589       As an exception to the following, the `exec' command returns 127 if the
590       command was not found or couldn't be executed, and the command's exit
591       value otherwise.
592
593       0   Success, or true for boolean queries.
594
595       1   False. Returned when a boolean return value is expected, e.g. when
596           running with --check, or for queries like opam lint.
597
598       2   Bad command-line arguments, or command-line arguments pointing to
599           an invalid context (e.g. file not following the expected format).
600
601       5   Not found. You requested something (package, version, repository,
602           etc.) that couldn't be found.
603
604       10  Aborted. The operation required confirmation, which wasn't given.
605
606       15  Could not acquire the locks required for the operation.
607
608       20  There is no solution to the user request. This can be caused by
609           asking to install two incompatible packages, for example.
610
611       30  Error in package definition, or other metadata files. Using
612           --strict raises this error more often.
613
614       31  Package script error. Some package operations were unsuccessful.
615           This may be an error in the packages or an incompatibility with
616           your system. This can be a partial error.
617
618       40  Sync error. Could not fetch some remotes from the network. This can
619           be a partial error.
620
621       50  Configuration error. Opam or system configuration doesn't allow
622           operation, and needs fixing.
623
624       60  Solver failure. The solver failed to return a sound answer. It can
625           be due to a broken external solver, or an error in solver
626           configuration.
627
628       99  Internal error. Something went wrong, likely due to a bug in opam
629           itself.
630
631       130 User interrupt. SIGINT was received, generally due to the user
632           pressing Ctrl-C.
633

FURTHER DOCUMENTATION

635       See https://opam.ocaml.org/doc.
636

AUTHORS

638       Vincent Bernardoff <vb@luminar.eu.org>
639       Raja Boujbel <raja.boujbel@ocamlpro.com>
640       Roberto Di Cosmo <roberto@dicosmo.org>
641       Thomas Gazagnaire <thomas@gazagnaire.org>
642       Louis Gesbert <louis.gesbert@ocamlpro.com>
643       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
644       Anil Madhavapeddy <anil@recoil.org>
645       Guillem Rieu <guillem.rieu@ocamlpro.com>
646       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
647       Frederic Tuong <tuong@users.gforge.inria.fr>
648

BUGS

650       Check bug reports at https://github.com/ocaml/opam/issues.
651
652
653
654Opam 2.1.2                                                        OPAM-LIST(1)
Impressum