OPAM-LIST(1)

NAME

opam-list - Display the list of available packages.

SYNOPSIS

opam list [OPTION]... [PATTERNS]...

DESCRIPTION

This command displays the list of installed packages when called without argument, or the list of available packages matching the given pattern.

Unless the --short switch is used, the output format displays one package per line, and each line contains the name of the package, the installed version or -- if the package is not installed, and a short description. In color mode, root packages (eg. manually installed) are underlined.

The full description can be obtained by doing opam info <package>. You can search through the package descriptions using the opam search command.

ARGUMENTS

PATTERNS
    List of package patterns.

OPTIONS

-a, --all
    List all the packages which can be installed on the system.

-A, --unavailable
    List all packages, even those which can't be installed on the system

--depends-on=PACKAGES
    List only packages that depend on one of PACKAGES.

--depopts
    Include optional dependencies in dependency requests.

-e [TAGS], --external[=TAGS] (default=)
    Instead of displaying the packages, display their external dependencies that are associated with any subset of the given TAGS (OS, distribution, etc.). Common tags include `debian', `x86', `osx', `homebrew', `source'... Without TAGS, display the tags and all associated external dependencies.

-i, --installed
    List installed packages only.

--installed-roots
    Display only the installed roots.

--recursive
    With `--depends-on' and `--required-by', display all transitive dependencies rather than just direct dependencies.

--required-by=PACKAGES
    List only the dependencies of PACKAGES.

-S, --sort
    Sort the packages in dependency order.

-s, --short
    Output the names separated by one whitespace instead of using the usual formatting.

COMMON OPTIONS

These options are common to all commands.

--color=WHEN (absent=auto)
    Colorize the output. WHEN must be `always', `never' or `auto'.

--compat-mode-1.0
    Compatibility mode with OPAM 1.0

--criteria=CRITERIA
    Specify user preferences for dependency solving for this run. Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details on the supported language, and the external solvers available, see http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A general guide to using solver preferences can be found at http://www.dicosmo.org/Articles/usercriteria.pdf. The default value is -count(down),-count(removed),-notuptodate(solution),-count(new) for upgrades, and -count(removed),-notuptodate(request),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution) otherwise.

--cudf=FILENAME
    Debug option: Save the CUDF requests sent to the solver to FILENAME-<n>.cudf.

--debug
    Print debug message to stderr. This is equivalent to setting $OPAMDEBUG to "true".

--debug-level=LEVEL
    Like `--debug', but allows specifying the debug level (`--debug' sets it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.

--git-version
    Print the git version if it exists and exit.

--help[=FMT] (default=pager)
    Show this help in format FMT (pager, plain or groff).

--no-base-packages
    Do not install base packages (useful for testing purposes). This is equivalent to setting $OPAMNOBASEPACKAGES to a non-empty string.

--no-self-upgrade
    OPAM will replace itself with a newer binary found at OPAMROOT/opam if present. This disables this behaviour.

-q, --quiet
    Be quiet when installing a new compiler.

--root=ROOT (absent=~/.opam)
    Use ROOT as the current root path. This is equivalent to setting $OPAMROOT to ROOT.

--safe
    Make sure nothing will be automatically updated or rewritten. Useful for calling from completion scripts, for example. Will fail whenever such an operation is needed ; also avoids waiting for locks, skips interactive questions and overrides the OPAMDEBUG variable.

--solver=CMD
    Specify the name of the external dependency solver. The default value is aspcud

--strict
    Fail whenever an error is found in a package definition or a configuration file. The default is to continue silently if possible.

--switch=SWITCH
    Use SWITCH as the current compiler switch. This is equivalent to setting $OPAMSWITCH to SWITCH.

--use-internal-solver, --no-aspcud
    Force use of internal heuristics, even if an external solver is available.

-v, --verbose
    Be more verbose. Show output of all sub-commands. This is equivalent to setting $OPAMVERBOSE to "true".

--version
    Show version information.

-y, --yes
    Disable interactive mode and answer yes to all questions that would otherwise be asked to the user. This is equivalent to setting $OPAMYES to "true".

ENVIRONMENT VARIABLES

OPAM makes use of the environment variables listed here. Boolean variables should be set to "0", "no" of "false" to disable, "1", "yes" or "true" to enable.

OPAMCOLOR, when set to always or never, sets a default value for the --color option.

OPAMCRITERIA specifies user preferences for dependency solving.The default value is -count(removed),-notuptodate(request),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution). See also option --criteria

OPAMCURL can be used to define an alternative for the 'curl' command-line utility to download files.

OPAMDEBUG see options `--debug' and `--debug-level'.

OPAMEXTERNALSOLVER see option `--solver'.

OPAMJOBS sets the maximum number of parallel workers to run.

OPAMNOASPCUD see option `--no-aspcud'.

OPAMNOSELFUPGRADE see option `--no-self-upgrade'.

OPAMROOT see option `--root'. This is automatically set by `opam config env --root=DIR' when DIR is non-default.

OPAMSOLVERTIMEOUT change the time allowance of the internal solver.

OPAMSWITCH see option `--switch'. Automatically set by `opam config env --switch=SWITCH'.

OPAMUPGRADECRITERIA specifies user preferences for dependency solving when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both are set.The default value is -count(down),-count(removed),-notuptodate(solution),-count(new). See also option --criteria

OPAMUTF8MSGS use nice UTF8 characters in OPAM messages.

OPAMVERBOSE see option `--verbose'.

OPAMVAR_var overrides the contents of the variable var when substituting `%{var}%` strings in `opam` files.

OPAMVAR_package_var overrides the contents of the variable package:var when substituting `%{package:var}%` strings in `opam` files.

OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.

OPAMYES see option `--yes'.

FURTHER DOCUMENTATION

See https://opam.ocaml.org.

AUTHORS

Thomas Gazagnaire <thomas@gazagnaire.org>

Anil Madhavapeddy <anil@recoil.org>

Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>

Frederic Tuong <tuong@users.gforge.inria.fr>

Louis Gesbert <louis.gesbert@ocamlpro.com>

Vincent Bernardoff <vb@luminar.eu.org>

Guillem Rieu <guillem.rieu@ocamlpro.com>

Roberto Di Cosmo <roberto@dicosmo.org>

BUGS

Check bug reports at https://github.com/ocaml/opam/issues.