OPAM-SHOW(1)
β¨ NAME β¨
opam-show β bestie, this is the command that spills the tea β about specific packages. We're talking display information about them, that's the whole vibe. π
(Also, for the record, this is from the Opam Manual, so you know it's official official. π)
πΈ SYNOPSIS πΈ
opam show [OPTION]β¦ [PACKAGES]β¦
π DESCRIPTION π
Okay so, this command shows you the whole information block for the package(s) you picked. Like, the full 411. π₯
The information block is made up of:
- the name of the package
- the installed version, if this package is installed in the currently selected compiler
- the list of available (installable) versions
- and a complete description
Lowkey if you just want a lil list of what's out there, use opam list instead β that gives you the list of available packages plus a short description for each one. No cap.
You can also point at paths to package definition files, or at directories that contain package definitions, and in that case opam will show you the corresponding metadata. π¦
Note: on terminals that support it, version numbers get colored, and here's the whole legend so you're not out here confused: - Magenta and bold: versions installed in the current switch - Bold: versions installed in other switches - Red and crossed: versions not available on the current platform - Gray: versions tagged with theavoid-versionordeprecatedflag
π ARGUMENTS π
PACKAGESβ a list of package names, and you can tack on an optional version or constraint, likepkg,pkg.1.0orpkg>=0.5; or it can be files or directory names containing a package description, with an explicit directory, e.g../foo.opamor.β¨
π OPTIONS π
--all-versionsβ shows you the info for all the packages matchingPACKAGES, instead of restraining itself to a single package that matches thePACKAGESconstraints. Let it cook, bestie. π₯--empty-fieldsβ shows fields that are empty. This one is implied whenever you pass--field.-f FIELDS,--field=FIELDSβ only displays the values of these fields, nothing else. Your field menu is:name,version,package,synopsis,synopsis-or-target,description,<field>,<field>:,installed-version,pin,source-hash,opam-file,all-installed-versions,available-versions,all-versions,repository,installed-files,vc-ref,depexts. You can separate multiple fields with commas, and in that case the field titles get printed. Oh and the raw value of anyopam-filefield can be queried by combining this with--raw. π--file=FILE(absent=-) β removed in 2.1, use--just-fileinstead. RIP to her. π--just-fileβ loads and displays information from the given files (so the allowedPACKAGEShere are file or directory paths), without any consideration for the repositories or the state of the package. This one implies--rawunless--fieldsis used. Only raw opam-file fields can be queried. And if you don't give aPACKAGESargument at all, it reads the opam file from stdin. π--list-filesβ lists the files installed by the package. It's equivalent to--field=installed-files, and it's only available for installed packages. π--no-lintβ don't output linting warnings or errors when reading from files.--normaliseβ prints the values of opam fields all normalised: no newlines, no implicit brackets. Clean. β¨--rawβ prints the raw opam file for this package.--sortβ sorts the opam fields. Main character energy: everything in its place. π--whereβ prints the location of the opam file used for this package. π
π COMMON OPTIONS π
These ones are common to all commands, so they show up everywhere. Periodt.
--best-effortβ don't fail if all the requested packages can't be installed; try to install as many as possible instead. Heads up though: not all external solvers support this option (recent versions ofaspcudormccsshould be fine). This is equivalent to setting the$OPAMBESTEFFORTenvironment variable.--cli=MAJOR.MINOR(absent=2.6) β use the command-line interface syntax and semantics ofMAJOR.MINOR. This one is intended for any persistent use of opam (scripts, blog posts, whatever), and any version of opam in the sameMAJORseries will behave as it did for the specifiedMINORrelease. FYI the flag wasn't available in opam 2.0, so to select the 2.0 CLI, set theOPAMCLIenvironment variable to2.0instead of using this parameter. π§--color=WHENβ colorize the output.WHENhas to be one ofalways,neverorauto.--confirm-level=LEVELβ confirmation level, andLEVELmust be one ofask,no,yesorunsafe-yes. You can pass this more than once. If--yesor--noare also given, the value of the last--confirm-levelis what counts. This is equivalent to setting$OPAMCONFIRMLEVEL.--criteria=CRITERIAβ specify your user preferences for dependency solving for this run. Overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. For the details on the supported language and the external solvers available, seehttp://opam.ocaml.org/doc/External_solvers.html. And a general guide to using solver preferences lives athttp://www.dicosmo.org/Articles/usercriteria.pdf. π--cudf=FILENAMEβ debug option: saves the CUDF requests sent to the solver toFILENAME-<n>.cudfwhere<n>is the n-th call to the solver during the opam run.--debugβ print debug messages to stderr. This is equivalent to setting$OPAMDEBUGto"true".--debug-level=LEVELβ like--debug, but it lets you specify the debug level (--debugjust sets it to1). Equivalent to setting$OPAMDEBUGto a positive integer.--git-versionβ print the git version of opam, if it's set (i.e. you're using a development version), and exit. π--help[=FMT](default=auto) β show this help in formatFMT. The valueFMTmust be one ofauto,pager,grofforplain. Withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined.--ignore-pin-dependsβ ignore the extra pins required by packages that get pinned, whether that's manually throughopam pinor throughopam install DIR. This is equivalent to settingIGNOREPINDEPENDS=true.--json=FILENAMEβ save the results of the opam run in a computer-readable file. If the filename contains the character%, it'll be replaced by an index that doesn't overwrite an existing file. Similar to setting the$OPAMJSONvariable. π€--noβ answer no to all opam yes/no questions without prompting. See also--confirm-level. This is equivalent to setting$OPAMNOto"true".--no-aspcudβ removed in 2.1. π--no-auto-upgradeβ when configuring or updating a repository that's written for an earlier opam version (1.2), opam internally converts it to the current format. This disables that behaviour. Note that repositories should define their format version in arepofile at their root, or they'll be assumed to be in the older format. It is, in any case, preferable to upgrade the repositories manually usingopam admin upgrade [--mirror URL]when possible.--no-self-upgradeβ opam will replace itself with a newer binary found atOPAMROOT/opamif present. This disables that behaviour. π«-q,--quietβ disables--verbose.--root=ROOTβ useROOTas the current root path. This is equivalent to setting$OPAMROOTtoROOT.--safe,--readonlyβ makes sure nothing will be automatically updated or rewritten. Handy for calling from completion scripts, for example. It'll fail whenever such an operation is needed ; it also avoids waiting for locks, skips interactive questions and overrides the$OPAMDEBUGvariable. This is equivalent to setting the environment variable$OPAMSAFE. π‘οΈ--solver=CMDβ specify the CUDF solver to use for resolving package installation problems. This is either a predefined solver β this version of opam supportsbuiltin-mccs+lp(),builtin-mccs+glpk,builtin-dummy-z3-solver,builtin-0install,aspcud,mccs,aspcud-old,packupβ or a custom command that should contain the variables%{input}%,%{output}%,%{criteria}%, and optionally%{timeout}%. This is equivalent to setting$OPAMEXTERNALSOLVER.--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β useSWITCHas the current compiler switch. This is equivalent to setting$OPAMSWITCHtoSWITCH.--use-internal-solverβ disable any external solver and use the built-in one (this requires that opam has been compiled with a built-in solver). This is equivalent to setting$OPAMNOASPCUDor$OPAMUSEINTERNALSOLVER.-v,--verboseβ be more verbose. One-vshows all package commands, and repeating it also displays commands called internally (e.g.tar,curl,patchetc.). Repeating n times is equivalent to setting$OPAMVERBOSEto"n". π£οΈ--versionβ show version information.-w,--working-dirβ whenever updating packages that are bound to a local, version-controlled directory, update to the current working state of their source instead of the last committed state, or the ref they're pointing to. Since the source directory is copied as it is, if it isn't clean it may result in an opam build failure. β οΈ This only affects packages explicitly listed on the command-line. It can also be set with$OPAMWORKINGDIR.-y,--yesβ answer yes to all opam yes/no questions without prompting. See also--confirm-level. This is equivalent to setting$OPAMYESto"true". π
π ENVIRONMENT π
okay so opam is literally listening to your environment the whole time π she reads a whole pile of variables and changes how she behaves. Iconic of her, honestly.
One thing before we go in: any boolean var here wants you to set it to "0", "no", "false" or the empty string to switch it off π«, and "1", "yes" or "true" to switch it on β
. Pick your fave, she's not picky.
OPAMALLPARENSβ surround all filters with parenthesis. group-chat energy: parentheses everywhere π«ΆOPAMASSUMEDEPEXTSβ see option--assume-depexts.OPAMAUTOANSWERβ internal use only. bestie this is not for you, it's for her πͺβ¨OPAMAUTOREMOVEβ see the remove option--auto-remove.OPAMBESTEFFORTβ see option--best-effort.OPAMBESTEFFORTPREFIXCRITERIAβ sets the string that has to be prepended to the criteria when--best-effortis in play, and it's expected to maximise theopam-queryproperty in the solution πOPAMBUILDDOCβ Removed in 2.1. π she's gone, she's in the past, we don't talk about herOPAMBUILDTESTβ Removed in 2.1. π same, byeOPAMCLIβ see option--cli.OPAMCOLORβ when set toalwaysornever, it sets a default value for the--coloroption. πOPAMCONFIRMLEVELβ see option--confirm-level. Heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO.OPAMCRITERIAβ specifies user preferences for dependency solving β¨ The default value depends on the solver version, so runconfig reportif you want to know the current setting. See also option--criteria.OPAMCUDFFILEβ save the cudf graph to file-actions-explicit.dot. πOPAMCUDFTRIMβ controls the filtering of unrelated packages during CUDF preprocessing.OPAMCURLβ use this to select a givencurlprogram. CheckOPAMFETCHfor more options.OPAMDEBUGβ see options--debugand--debug-level.OPAMDEBUGSECTIONSβ if set, it limits debug messages to the space-separated list of sections. Sections can optionally carry a specific debug level (like, for example,CLIENT:2orCLIENT CUDF:2), but otherwise use--debug-level. πOPAMDIGDEPTHβ defines how aggressive the lookup for conflicts is during CUDF preprocessing. πOPAMDOWNLOADJOBSβ sets the max number of simultaneous downloads. πOPAMDROPWORKINGDIRβ overrides packages that were previously updated with--working-diron update. Without this variable set, opam would keep them unchanged unless you explicitly named them on the command-line.OPAMDRYRUNβ see option--dry-run.OPAMEDITORβ sets the editor used for opam file editing, and it overrides$EDITORand$VISUAL. she's the main character here πOPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails. Set it to0to print all of them. πOPAMEXTERNALSOLVERβ see option--solver.OPAMFAKEβ see option--fake.OPAMFETCHβ specifies how to download files β¨ Eitherwget,curl, or a custom command where the variables%{url}%,%{out}%,%{retry}%,%{compress}%and%{checksum}%get replaced. It overrides thedownload-commandvalue from the main config file.OPAMFIXUPCRITERIAβ same asOPAMUPGRADECRITERIA, but specifically for fixup and reinstall.OPAMIGNOREAVAILABLEβ see the install option--ignore-available-on.OPAMIGNORECONSTRAINTSβ see the install option--ignore-constraints-on.OPAMIGNOREPINDEPENDSβ see option--ignore-pin-depends.OPAMINPLACEBUILDβ see option--inplace-build.OPAMJOBSβ sets the max number of parallel workers to run. πΈOPAMJSONβ log json output to the given file (use the character%to index the files).OPAMKEEPBUILDDIRβ see the install option--keep-build-dir.OPAMKEEPLOGSβ tells opam to not remove some temporary command logs and some backups. This skips some finalisers and may also help you get more reliable backtraces. π«ΆOPAMLOCKEDβ the combination of the--lockedand--lock-suffixoptions. πOPAMLOGSβ logdir; sets the log directory, and the default is a temporary directory in/tmp.OPAMMAKECMDβ set the system make command to use.OPAMMERGEOUTβ merge process outputs, stderr on stdout. πͺOPAMNOβ answer no to any question asked, see options--noand--confirm-level. Note thatOPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set.OPAMNOAGGREGATEβ withopam admin check, don't aggregate packages.OPAMNOASPCUDβ Deprecated. πOPAMNOAUTOUPGRADEβ disables the automatic internal upgrade of repositories in an earlier format to the current one, onupdateorinit.OPAMNOCHECKSUMSβ enables option--no-checksumswhen available.OPAMNODEPEXTSβ disables system dependencies handling, see option--no-depexts.OPAMNOENVNOTICEβ Internal. πͺOPAMNOSELFUPGRADEβ see option--no-self-upgrade.OPAMPINKINDAUTOβ sets whether version control systems should be detected when pinning to a local path. Enabled by default since 1.3.0. πOPAMPRECISETRACKINGβ fine grain tracking of directories.OPAMPREPROβ set this tofalseto disable CUDF preprocessing. Less efficient, but it might help you debug a solver issue. πOPAMREPOSITORYTARRINGβ internally store all non-vcs repositories astar.gzfiles (by default, http repositories are stored as archive). This can be much faster on filesystems that don't cope well with scanning large trees. All operations are done in-memory, no I/O for scanning the repository. π₯OPAMREQUIRECHECKSUMSβ enables option--require-checksumswhen available (e.g. foropam install).OPAMRETRIESβ sets the number of tries before failing downloads. πOPAMREUSEBUILDDIRβ see option--reuse-build-dir.OPAMROOTβ see option--root. This is automatically set byopam env --root=DIR --set-root. π±OPAMROOTISOKβ don't complain when running as root. πOPAMSAFEβ see option--safe.OPAMSHOWβ see option--show. (hiii bestie that's literally us right now ππ«Ά)OPAMSKIPUPDATEβ see option--skip-updates.OPAMSKIPVERSIONCHECKSβ bypasses some version checks. Unsafe, for compatibility testing only. β οΈOPAMSOLVERALLOWSUBOPTIMALβ (defaulttrue) allows some solvers to still return a solution when they reach timeout; while the solution remains assured to be consistent, there is no guarantee in this case that it fits the expected optimisation criteria. Iftrue, opam will continue with a warning; iffalse, a timeout is an error. Currently only the builtin-z3 backend handles this degraded case.OPAMSOLVERTIMEOUTβ change the time allowance of the solver. Default is60.0, set it to0for unlimited. Note that all solvers may not support this option. β°OPAMSOLVERTOLERANCEβ changes the tolerance towards the solver choosing an unoptimized solution (i.e. it might pull outdated packages π¬). Typical values range from0.0(best solution known to the solver) to1.0(unoptimized solution). Default is0.0. This one is useful in case the solver can't find a solution in a reasonable time (see$OPAMSOLVERTIMEOUT). Note that all solvers may not support this option.OPAMSTATSβ Removed in 2.4. π she's not with us anymoreOPAMSTATUSLINEβ display a dynamic status line showing what's currently going on on the terminal. (the manpage literally says "one of one of always, never or auto", and honestly? the double "one of" is giving typo but she's a legend so we keep her π β the actual values arealways,neverorauto.)OPAMSTRICTβ fail on inconsistencies (file reading, switch import, etc.). π¨OPAMSWITCHβ see option--switch. Automatically set byopam env --switch=SWITCH --set-switch. πOPAMUNLOCKBASEβ see the install option--unlock-base.OPAMUPGRADECRITERIAβ specifies user preferences for dependency solving when performing an upgrade. It overridesOPAMCRITERIAin upgrades if both are set. See also option--criteria. β¨OPAMUSEINTERNALSOLVERβ see option--use-internal-solver.OPAMUSEOPENSSLβ Removed in 2.2. πOPAMUTF8β use UTF8 characters in output (again the manpage says "one of one of always, never or auto", love that for her β the values arealways,neverorauto). By default it'sauto, which is determined from the locale. πOPAMUTF8MSGSβ use extended UTF8 characters (camels πͺ) in opam messages. ImpliesOPAMUTF8. This is set by default on macOS only.OPAMVALIDATIONHOOKβ if set, uses the%{hook}%command to validate an opam repository update.OPAMVERBOSEβ see option--verbose.OPAMVERBOSEONβ see option--verbose-on.OPAMVERSIONLAGPOWERβ do not use. π that's it. that's the whole description. she said "do not use" and left. icon behaviour.OPAMWITHDEVSETUPβ see the install option--with-dev-setup.OPAMWITHDOCβ see the install option--with-doc.OPAMWITHTESTβ see the install option--with-test.OPAMWORKINGDIRβ see option--working-dir.OPAMYESβ see options--yesand--confirm-level.OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVELis set. βOPAMVAR_varβ overrides the contents of the variable var when substituting%{var}%strings inopamfiles. πOPAMVAR_package_varβ overrides the contents of the variable package:var when substituting%{package:var}%strings inopamfiles. π
π οΈ CLI VERSION π οΈ
okay bestie this section is actually so important so paws and read it π«Ά
All scripts and programmatic invocations of opam should use --cli in order to ensure that they work seamlessly with future versions of the opam client. β¨ And it's not just for scripts β blog posts or other documentation can benefit too, because it prevents information from becoming stale. no cap.
Although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. π°οΈ
Since CLI version support was only added in opam 2.1, use OPAMCLI to select 2.0 support (since opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions β because an environment variable controlling the parsing of syntax is brittle. π To this end, opam displays a warning if OPAMCLI specifies a valid version other than 2.0, and also if --cli=2.0 is specified.
The command-line version is selected by using the --cli option or the OPAMCLI environment variable. --cli may be specified more than once, where the last instance takes precedence. π OPAMCLI is only inspected if --cli is not given.
π¦ EXIT STATUS π¦
okay so plot twist β there's one exception to everything you're about to read, and it's the exec command. exec returns 127 if the command wasn't found or couldn't be executed at all, and otherwise it hands you back the command's own exit value. different rules, same page, iykyk. π
0β Success, or true for boolean queries. the good ending bestie β¨1β False. Returned when a boolean return value is expected, e.g. when running with--check, or for queries likeopam lint. not an error, just a "no"2β Bad command-line arguments, or command-line arguments pointing to an invalid context (e.g. file not following the expected format). bestie you typed it wrong π5β Not found. You requested something (package, version, repository, etc.) that couldn't be found. she's not here π10β Aborted. The operation required confirmation, which wasn't given. you said no, or you didn't say yes π«Ά15β Could not acquire the locks required for the operation. the lock was locked, no cap20β There is no solution to the user request. This can be caused by asking to install two incompatible packages, for example. physically impossible, sorry babe30β Error in package definition, or other metadata files. Using--strictraises this error more often. ππ₯31β Package script error. Some package operations were unsuccessful. This may be an error in the packages or an incompatibility with your system. This can be a partial error. she tried and tripped π₯²40β Sync error. Could not fetch some remotes from the network. This can be a partial error. the wifi said no π50β Configuration error. Opam or system configuration doesn't allow operation, and needs fixing. π§60β Solver failure. The solver failed to return a sound answer. It can be due to a broken external solver, or an error in solver configuration. the solver got confused fr fr99β Internal error. Something went wrong, likely due to a bug in opam itself. not us, it's them (it's us) π«£130β User interrupt.SIGINTwas received, generally due to the user pressing Ctrl+C. bestie you panicked π
and then, the generic ones:
0β on success. β123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs). a bug spotted in the wild π
π FURTHER DOCUMENTATION π
More reading, more slaying β head over to https://opam.ocaml.org/doc. π
π AUTHORS π
the iconic legends who made this happen, put some respect on their names:
David Allsopp <david@tarides.com>Vincent Bernardoff <vb@luminar.eu.org>Raja Boujbel <raja.boujbel@ocamlpro.com>
β¦and the second lineup, equally iconic:
Kate Deplaix <kit-ty-kate@exn.st>Roberto Di Cosmo <roberto@dicosmo.org>Thomas Gazagnaire <thomas@gazagnaire.org>Louis Gesbert <louis.gesbert@ocamlpro.com>Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>Anil Madhavapeddy <anil@recoil.org>Guillem Rieu <guillem.rieu@ocamlpro.com>Ralf Treinen <ralf.treinen@pps.jussieu.fr>Frederic Tuong <tuong@users.gforge.inria.fr>
π¦ SEE ALSO π¦
opam(1)β the main character, obviously π
π BUGS π
Found something cursed? Check bug reports at https://github.com/ocaml/opam/issues. be nice, the maintainers are people too π«Ά
aaaand that's the whole page bestie, you read every single line of it, main character energy ππ
this page came from Opam 2.6.1, and the date slot at the bottom just reads OPAM-SHOW(1) β so that's the manual page name doing double duty as the timestamp. iconic behavior honestly. go confuse your friends with exit code 130, love u, bye β¨ππ¦
π¦ where this page comes from
- arch rolling: opam 2.6.1-1 Β· LGPL-2.1-only
- fedora 44: opam 2.6.1-1.fc44 Β· LGPL-2.1-only WITH OCaml-LGPL-linking-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms