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

ENVIRONMENT

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

CLI VERSION

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

EXIT STATUS

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

FURTHER DOCUMENTATION

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

AUTHORS

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

BUGS

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