1OPAM-LIST(1) Opam Manual OPAM-LIST(1)
2
3
4
6 opam-list - Display the list of available packages.
7
9 opam list [OPTION]... [PATTERNS]...
10
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
33 PATTERNS
34 Package patterns with globs. Unless --search is specified, they
35 match againsta NAME or NAME.VERSION
36
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
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
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
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 This is equivalent to setting $OPAMBESTEFFORT environment variable.
212
213 --color=WHEN
214 Colorize the output. WHEN must be one of `always', `never' or
215 `auto'.
216
217 --criteria=CRITERIA
218 Specify user preferences for dependency solving for this run.
219 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
220 on the supported language, and the external solvers available, see
221 http://opam.ocaml.org/doc/External_solvers.html. A general guide to
222 using solver preferences can be found at
223 http://www.dicosmo.org/Articles/usercriteria.pdf.
224
225 --cudf=FILENAME
226 Debug option: Save the CUDF requests sent to the solver to
227 FILENAME-<n>.cudf.
228
229 --debug
230 Print debug message to stderr. This is equivalent to setting
231 $OPAMDEBUG to "true".
232
233 --debug-level=LEVEL
234 Like --debug, but allows specifying the debug level (--debug sets
235 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
236
237 --git-version
238 Print the git version of opam, if set (i.e. you are using a
239 development version), and exit.
240
241 --help[=FMT] (default=auto)
242 Show this help in format FMT. The value FMT must be one of `auto',
243 `pager', `groff' or `plain'. With `auto', the format is `pager` or
244 `plain' whenever the TERM env var is `dumb' or undefined.
245
246 --ignore-pin-depends
247 Ignore extra pins required by packages that get pinned, either
248 manually through opam pin or through opam install DIR. This is
249 equivalent to setting IGNOREPINDEPENDS=true.
250
251 --json=FILENAME
252 Save the results of the opam run in a computer-readable file. If
253 the filename contains the character `%', it will be replaced by an
254 index that doesn't overwrite an existing file. Similar to setting
255 the $OPAMJSON variable.
256
257 --no-aspcud
258 Deprecated.
259
260 --no-auto-upgrade
261 When configuring or updating a repository that is written for an
262 earlier opam version (1.2), opam internally converts it to the
263 current format. This disables this behaviour. Note that
264 repositories should define their format version in a 'repo' file at
265 their root, or they will be assumed to be in the older format. It
266 is, in any case, preferable to upgrade the repositories manually
267 using opam admin upgrade [--mirror URL] when possible.
268
269 --no-self-upgrade
270 Opam will replace itself with a newer binary found at OPAMROOT/opam
271 if present. This disables this behaviour.
272
273 -q, --quiet
274 Disables --verbose.
275
276 --root=ROOT
277 Use ROOT as the current root path. This is equivalent to setting
278 $OPAMROOT to ROOT.
279
280 --safe, --readonly
281 Make sure nothing will be automatically updated or rewritten.
282 Useful for calling from completion scripts, for example. Will fail
283 whenever such an operation is needed ; also avoids waiting for
284 locks, skips interactive questions and overrides the $OPAMDEBUG
285 variable. This is equivalent to set environment variable $OPAMSAFE.
286
287 --solver=CMD
288 Specify the CUDF solver to use for resolving package installation
289 problems. This is either a predefined solver (this version of opam
290 supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
291 aspcud-old, packup), or a custom command that should contain the
292 variables %{input}%, %{output}%, %{criteria}%, and optionally
293 %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
294
295 --strict
296 Fail whenever an error is found in a package definition or a
297 configuration file. The default is to continue silently if
298 possible.
299
300 --switch=SWITCH
301 Use SWITCH as the current compiler switch. This is equivalent to
302 setting $OPAMSWITCH to SWITCH.
303
304 --use-internal-solver
305 Disable any external solver, and use the built-in one (this
306 requires that opam has been compiled with a built-in solver). This
307 is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
308
309 -v, --verbose
310 Be more verbose. One -v shows all package commands, repeat to also
311 display commands called internally (e.g. tar, curl, patch etc.)
312 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
313
314 --version
315 Show version information.
316
317 -w, --working-dir
318 Whenever updating packages that are bound to a local,
319 version-controlled directory, update to the current working state
320 of their source instead of the last committed state, or the ref
321 they are pointing to. This only affects packages explicitly listed
322 on the command-line.It can also be set with $OPAMWORKINGDIR.
323
324 -y, --yes
325 Answer yes to all yes/no questions without prompting. This is
326 equivalent to setting $OPAMYES to "true".
327
329 Opam makes use of the environment variables listed here. Boolean
330 variables should be set to "0", "no", "false" or the empty string to
331 disable, "1", "yes" or "true" to enable.
332
333 OPAMALLPARENS surround all filters with parenthesis
334
335 OPAMAUTOREMOVE see remove option `--auto-remove`
336
337 OPAMBESTEFFORT see option `--best-effort`
338
339 OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
340 the criteria when the `--best-effort` option is set, and is expected to
341 maximise the `opam-query` property in the solution
342
343 OPAMCOLOR, when set to always or never, sets a default value for the
344 --color option.
345
346 OPAMCRITERIA specifies user preferences for dependency solving. The
347 default value depends on the solver version, use `config report` to
348 know the current setting. See also option --criteria
349
350 OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
351
352 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
353 for more options.
354
355 OPAMDEBUG see options `--debug' and `--debug-level'.
356
357 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
358
359 OPAMDRYRUN see option `--dry-run`
360
361 OPAMEDITOR sets the editor to use for opam file editing, overrides
362 $EDITOR and $VISUAL
363
364 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
365 fails. 0 to print all.
366
367 OPAMEXTERNALSOLVER see option `--solver'.
368
369 OPAMFAKE see option `--fake`
370
371 OPAMFETCH specifies how to download files: either `wget', `curl' or a
372 custom command where variables %{url}%, %{out}%, %{retry}%,
373 %{compress}% and %{checksum}% will be replaced. Overrides the
374 'download-command' value from the main config file.
375
376 OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
377
378 OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
379
380 OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
381
382 OPAMJOBS sets the maximum number of parallel workers to run.
383
384 OPAMJSON log json output to the given file (use character `%' to index
385 the files)
386
387 OPAMLOCKED see install option `--locked`
388
389 OPAMLOGS logdir sets log directory, default is a temporary directory in
390 /tmp
391
392 OPAMMAKECMD set the system make command to use
393
394 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
395 in an earlier format to the current one, on 'update' or 'init'.
396
397 OPAMKEEPLOGS tells opam to not remove some temporary command logs and
398 some backups. This skips some finalisers and may also help to get more
399 reliable backtraces
400
401 OPAMLOCKRETRIES sets the number of tries after which opam gives up
402 acquiring its lock and fails. <= 0 means infinite wait.
403
404 OPAMMERGEOUT merge process outputs, stderr on stdout
405
406 OPAMNO answer no to any question asked.
407
408 OPAMNOASPCUD Deprecated.
409
410 OPAMNOCHECKSUMS enables option --no-checksums when available.
411
412 OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
413
414 OPAMPINKINDAUTO sets whether version control systems should be detected
415 when pinning to a local path. Enabled by default since 1.3.0.
416
417 OPAMPRECISETRACKING fine grain tracking of directories
418
419 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
420 available (e.g. for `opam install`).
421
422 OPAMRETRES sets the number of tries before failing downloads.
423
424 OPAMROOT see option `--root'. This is automatically set by `opam env
425 --root=DIR --set-root'.
426
427 OPAMROOTISOK don't complain when running as root.
428
429 OPAMSAFE see option `--safe'
430
431 OPAMSHOW see option `--show`
432
433 OPAMSKIPUPDATE see option `--skip-updates`
434
435 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
436 compatibility testing only.
437
438 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
439 60.0, set to 0 for unlimited. Note that all solvers may not support
440 this option.
441
442 OPAMSTATUSLINE display a dynamic status line showing what's currently
443 going on on the terminal. (one of one of `always', `never' or `auto')
444
445 OPAMSTATS display stats at the end of command
446
447 OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
448
449 OPAMSWITCH see option `--switch'. Automatically set by `opam env
450 --switch=SWITCH --set-switch'.
451
452 OPAMUNLOCKBASE see install option `--unlock-base`
453
454 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
455 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
456 are set. See also option --criteria
457
458 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
459
460 OPAMUSEOPENSSL force openssl use for hash computing
461
462 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
463 or `auto'). By default `auto', which is determined from the locale).
464
465 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
466 Implies OPAMUTF8. This is set by default on OSX only.
467
468 OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
469 an opam repository update
470
471 OPAMVAR_var overrides the contents of the variable var when
472 substituting `%{var}%` strings in `opam` files.
473
474 OPAMVAR_package_var overrides the contents of the variable package:var
475 when substituting `%{package:var}%` strings in `opam` files.
476
477 OPAMVERBOSE see option `--verbose'.
478
479 OPAMWORKINGDIR see option `--working-dir`
480
481 OPAMYES see option `--yes'.
482
484 As an exception to the following, the `exec' command returns 127 if the
485 command was not found or couldn't be executed, and the command's exit
486 value otherwise.
487
488 0 Success, or true for boolean queries.
489
490 1 False. Returned when a boolean return value is expected, e.g. when
491 running with --check, or for queries like opam lint.
492
493 2 Bad command-line arguments, or command-line arguments pointing to
494 an invalid context (e.g. file not following the expected format).
495
496 5 Not found. You requested something (package, version, repository,
497 etc.) that couldn't be found.
498
499 10 Aborted. The operation required confirmation, which wasn't given.
500
501 15 Could not acquire the locks required for the operation.
502
503 20 There is no solution to the user request. This can be caused by
504 asking to install two incompatible packages, for example.
505
506 30 Error in package definition, or other metadata files. Using
507 --strict raises this error more often.
508
509 31 Package script error. Some package operations were unsuccessful.
510 This may be an error in the packages or an incompatibility with
511 your system. This can be a partial error.
512
513 40 Sync error. Could not fetch some remotes from the network. This can
514 be a partial error.
515
516 50 Configuration error. Opam or system configuration doesn't allow
517 operation, and needs fixing.
518
519 60 Solver failure. The solver failed to return a sound answer. It can
520 be due to a broken external solver, or an error in solver
521 configuration.
522
523 99 Internal error. Something went wrong, likely due to a bug in opam
524 itself.
525
526 130 User interrupt. SIGINT was received, generally due to the user
527 pressing Ctrl-C.
528
530 See https://opam.ocaml.org/doc.
531
533 Vincent Bernardoff <vb@luminar.eu.org>
534 Raja Boujbel <raja.boujbel@ocamlpro.com>
535 Roberto Di Cosmo <roberto@dicosmo.org>
536 Thomas Gazagnaire <thomas@gazagnaire.org>
537 Louis Gesbert <louis.gesbert@ocamlpro.com>
538 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
539 Anil Madhavapeddy <anil@recoil.org>
540 Guillem Rieu <guillem.rieu@ocamlpro.com>
541 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
542 Frederic Tuong <tuong@users.gforge.inria.fr>
543
545 Check bug reports at https://github.com/ocaml/opam/issues.
546
547
548
549Opam 2.0.6 OPAM-LIST(1)