OPAM-INFO(1)
π OPAM-INFO(1) π
okay so this is the manual page for opam-info, which lives in the Opam Manual (yes, that's the manual name, that's the vibe) β¨ part 1 of 3, so don't go anywhere bestie, there's more coming π«Ά
πΈ NAME πΈ
opam-info β it's an alias for show. that's it. that's the whole entire job description. no cap. π
π SYNOPSIS π
opam info [OPTION]β¦ [PACKAGES]β¦
π¦ DESCRIPTION π¦
so like, opam info is literally just another name for opam show. they're the same thing. the same girl, two outfits. π
like, if you wanna know the actual details, go read opam show --help, because that's where the real tea is. π
β¨ ARGUMENTS β¨
PACKAGESβ a list of package names, and you can optionally throw a version or a constraint on them, e.g.pkg,pkg.1.0orpkg>=0.5. OR it can be files / directory names that contain a package description, and for those you have to give the explicit directory (think./foo.opamor.). fr fr. π
π OPTIONS π
--all-versionsβ show info for all the packages that matchPACKAGES, instead of being restrained to just one single package that matches thePACKAGESconstraints. let her be free. π¦--empty-fieldsβ show the fields that are empty too. and not me telling you this: it's implied whenever you pass--field. so it just comes along for the ride. π-f FIELDS,--field=FIELDSβ only show the values of these specific fields, bestie. you can pick from: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 ones with commas, and if you do, the field titles get printed too. and you can query the raw value of anyopam-filefield by combining it with--raw. iykyk π--file=FILE(absent=-) β removed in 2.1, use--just-fileinstead. she's gone, she's not coming back, rip π--just-fileβ load and display info from the given files (allowedPACKAGEShere are file or directory paths), and it does not care about the repositories or the state of the package. this implies--rawunless--fieldsis used. only raw opam-file fields can be queried. and if you give noPACKAGESargument at all, it reads the opam file from stdin. main character energy, reading from stdin and all π--list-filesβ list the files that the package installed. equivalent to--field=installed-files, and heads up: it's only available for installed packages. no install, no list. π--no-lintβ don't output linting warnings or errors when reading from files. silence is golden β¨--normaliseβ print the values of opam fields all normalised: no newlines, no implicit brackets. tidy. clean. iconic. π--rawβ print the raw opam file for this package. the whole thing, unfiltered. π₯--sortβ sort the opam fields. alphabetical slay π--whereβ print the location of the opam file used for this package. so you know where the drama is coming from. π
π COMMON OPTIONS π
these options are common to all commands, so like, they show up everywhere. periodt.
--best-effortβ don't fail if all the requested packages can't be installed: just try to install as many as possible. note that not all external solvers may support this option (recent versions ofaspcudormccsshould tho). 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's intended for any persistent use of opam (scripts, blog posts, etc.) β any version of opam in the sameMAJORseries will behave as it did for the specifiedMINORrelease. 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. okay nostalgia π--color=WHENβ colorize the output.WHENhas to be one ofalways,neverorauto. pick your aesthetic πΈ--confirm-level=LEVELβ confirmation level, andLEVELmust be one ofask,no,yesorunsafe-yes. can be specified more than once. if--yesor--noare also given, the value of the last--confirm-levelis what counts. this is equivalent to setting$OPAMCONFIRMLEVEL. β οΈ (unsafe-yesis literally named unsafe, bestie, tread carefully)--criteria=CRITERIAβ specify your user preferences for dependency solving for this run. it overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. for 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: save the CUDF requests sent to the solver toFILENAME-<n>.cudfwhere<n>is the n-th call to the solver during the opam run. detective mode π--debugβ print debug messages to stderr. this is equivalent to setting$OPAMDEBUGto"true". π--debug-level=LEVELβ like--debug, but you get to specify the debug level (--debugjust sets it to1). equivalent to setting$OPAMDEBUGto a positive integer. dial it up π--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. bestie behaviour fr π«Ά--ignore-pin-dependsβ ignore extra pins required by packages that get pinned, whether 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 gets replaced by an index that doesn't overwrite an existing file. similar to setting the$OPAMJSONvariable. data girlie β¨--noβ answer no to all opam yes/no questions without prompting. see also--confirm-level. this is equivalent to setting$OPAMNOto"true". just say no π«--no-aspcudβ removed in 2.1. she's not here anymore bestie π--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 a'repo'file 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. no glow-ups today π-q,--quietβ disables--verbose. shhh π€«--root=ROOTβ useROOTas the current root path. this is equivalent to setting$OPAMROOTtoROOT. π³--safe,--readonlyβ make sure nothing will be automatically updated or rewritten. super useful for calling from completion scripts, for example. it will fail whenever such an operation is needed; it also avoids waiting for locks, skips interactive questions and overrides the$OPAMDEBUGvariable. this is equivalent to set environment variable$OPAMSAFE. look but don't touch π--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. solver slay π§--strictβ fail whenever an error is found in a package definition or a configuration file. the default is to continue silently if possible. glowing difference between the two ngl β¨--switch=SWITCHβ useSWITCHas the current compiler switch. this is equivalent to setting$OPAMSWITCHtoSWITCH. flick the switch π‘--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. homegrown solver energy π-v,--verboseβ be more verbose. one-vshows all package commands, and you repeat it to also display commands called internally (e.g.tar,curl,patchetc.). repeating it n times is equivalent to setting$OPAMVERBOSEto"n". give me all the lore π’--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. and because the source directory is copied as it is, if it isn't clean it may result in a opam build failure. this only affects packages explicitly listed on the command-line. it can also be set with$OPAMWORKINGDIR. β οΈ clean your dir first bestie-y,--yesβ answer yes to all opam yes/no questions without prompting. see also--confirm-level. this is equivalent to setting$OPAMYESto"true". yes queen π
β¦and that's not even the whole page π stay tuned π
πΈ ENVIRONMENT πΈ
Okay bestie, buckle up, because opam is obsessed with environment variables and there are like a million of them. opam makes use of the environment variables listed here. π
β¨ Pro tip for the boolean ones: set them to"0","no","false"or just an empty string to disable them, and"1","yes"or"true"to enable them. That's the whole vibe check. π
OPAMALLPARENSβ surround all filters with parenthesis. Yes, all of them. π«ΆOPAMASSUMEDEPEXTSβ see option `--assume-depexts'.OPAMAUTOANSWERβ internal use only. Don't touch, it's not for us. πOPAMAUTOREMOVEβ see remove option `--auto-remove'.OPAMBESTEFFORTβ see option `--best-effort'.OPAMBESTEFFORTPREFIXCRITERIAβ sets the string that must be prepended to the criteria when the--best-effort' option is set, and is expected to maximise theopam-query' property in the solution. Very demure, very mindful. πOPAMBUILDDOCβ Removed in 2.1. RIP girl, you're gone. πOPAMBUILDTESTβ Removed in 2.1. Also gone. πOPAMCLIβ see option `--cli'.OPAMCOLORβ when set toalwaysornever, sets a default value for the--coloroption.OPAMCONFIRMLEVELβ see option--confirm-level. Heads up bestie: OPAMCONFIRMLEVEL has priority overOPAMYESandOPAMNO. πOPAMCRITERIAβ specifies user preferences for dependency solving. The default value depends on the solver version, so useconfig report' to find out what the current setting is. 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β can be used to select a given 'curl' program. SeeOPAMFETCHfor more options.OPAMDEBUGβ see options--debug' and--debug-level'.OPAMDEBUGSECTIONSβ if set, limits debug messages to the space-separated list of sections. Sections can optionally have a specific debug level (for example,CLIENT:2orCLIENT CUDF:2, but otherwise use `--debug-level'.OPAMDIGDEPTHβ defines how aggressive the lookup for conflicts during CUDF preprocessing is.OPAMDOWNLOADJOBSβ sets the maximum number of simultaneous downloads. No more chaotic parallel chaos than this number allows. β¨OPAMDROPWORKINGDIRβ overrides packages previously updated with--working-diron update. Without this variable set, opam would keep them unchanged unless they're explicitly named on the command-line.OPAMDRYRUNβ see option `--dry-run'.OPAMEDITORβ sets the editor to use for opam file editing, and it overrides$EDITORand$VISUAL. Main character energy only. πOPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails.0prints all of them. 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}%will be replaced. Overrides the'download-command'value from the main config file.OPAMFIXUPCRITERIAβ same asOPAMUPGRADECRITERIA, but specific to fixup and reinstall. Same energy, different context. πOPAMIGNOREAVAILABLEβ see install option `--ignore-available-on'.OPAMIGNORECONSTRAINTSβ see install option `--ignore-constraints-on'.OPAMIGNOREPINDEPENDSβ see option `--ignore-pin-depends'.OPAMINPLACEBUILDβ see option `--inplace-build'.OPAMJOBSβ sets the maximum number of parallel workers to run. Go off, workers. π₯OPAMJSONβ log json output to the given file (use the character%to index the files).OPAMKEEPBUILDDIRβ see 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 to get more reliable backtraces.OPAMLOCKEDβ combination of--locked' and--lock-suffix' options.OPAMLOGSβlogdirsets log directory, 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. Careful though:OPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set. π«£OPAMNOAGGREGATEβ with `opam admin check', don't aggregate packages.OPAMNOASPCUDβ Deprecated. Bestie, it's over. πOPAMNOAUTOUPGRADEβ disables automatic internal upgrade of repositories in an earlier format to the current one, on'update'or'init'.OPAMNOCHECKSUMSβ enables option--no-checksumswhen available.OPAMNODEPEXTSβ disables system dependencies handling, see option `--no-depexts'.OPAMNOENVNOTICEβ Internal. π€«OPAMNOSELFUPGRADEβ see option--no-self-upgradeOPAMPINKINDAUTOβ 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 to false to disable CUDF preprocessing. Less efficient, but might help debugging solver issues. Sometimes the messier way is the way. πOPAMREPOSITORYTARRINGβ internally store all non-vcs repositories as tar.gz files (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. Literally iconic. β¨OPAMREQUIRECHECKSUMSβ enables option--require-checksums' when 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. Yes ma'am, live your truth. πOPAMSAFEβ see option `--safe'.OPAMSHOWβ see option `--show'.OPAMSKIPUPDATEβ see option `--skip-updates'.OPAMSKIPVERSIONCHECKSβ bypasses some version checks. Unsafe, for compatibility testing only. Do not do this casually, bestie, I'm serious. π¨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, iffalsea 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 to0for unlimited. Note that all solvers may not support this option.OPAMSOLVERTOLERANCEβ changes the tolerance towards the solver choosing an unoptimized solution (i.e. might pull outdated packages). Typical values range from0.0(best solution known to the solver) to1.0(unoptimized solution). Default is0.0. This option 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. Gone but not forgotten. ποΈOPAMSTATUSLINEβ display a dynamic status line showing what's currently going on on the terminal. (one of one ofalways,neverorautoβ yeah it says "one of" twice, we love her for that π)OPAMSTRICTβ fail on inconsistencies (file reading, switch import, etc.). No chaos allowed. βOPAMSWITCHβ see option--switch'. Automatically set byopam env --switch=SWITCH --set-switch'.OPAMUNLOCKBASEβ see install option `--unlock-base'.OPAMUPGRADECRITERIAβ specifies user preferences for dependency solving when performing an upgrade. OverridesOPAMCRITERIAin upgrades if both are set. See also option--criteria.OPAMUSEINTERNALSOLVERβ see option `--use-internal-solver'.OPAMUSEOPENSSLβ Removed in 2.2. Another one bites the dust. πOPAMUTF8β use UTF8 characters in output (one of one ofalways,neverorauto). By defaultauto, 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-onOPAMVERSIONLAGPOWERβ do not use. That's it. That's the whole description. πOPAMWITHDEVSETUPβ see install option `--with-dev-setup'.OPAMWITHDOCβ see install option `--with-doc'.OPAMWITHTESTβ see install option `--with-test.OPAMWORKINGDIRβ see option `--working-dir'.OPAMYESβ see options--yes' and--confirm-level. **OPAMYEShas priority overOPAMNOand is ignored ifOPAMCONFIRMLEVEL` is set.**OPAMVAR_varβ overrides the contents of the variablevarwhen substituting%{var}%strings inopamfiles.OPAMVAR_package_varβ overrides the contents of the variablepackage:varwhen substituting%{package:var}%strings inopamfiles.
π¦ CLI VERSION π¦
OK this section is short but it's important, so listen up bestie. π
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. Plus, blog posts or other documentation can benefit too, because it prevents information from becoming stale. Future-proofing? We love to see it. π
Although opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. Sweet of her tbh. π«Ά
Since CLI version support was only added in opam 2.1, use OPAMCLI to select 2.0 support (as 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. She's calling you out, gently. π
The command-line version is selected by using the --cli' option or the OPAMCLIenvironment 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 this is the part where opam tells you why it's leaving, and bestie, the numbers MATTER. Remember: it's not just "it broke" β every number is a whole mood, and you gotta read the number to know what's up. π
π¨ ONE HUGE EXCEPTION THO: theexeccommand plays by its own rules.execreturns127if the command wasn't found or couldn't be executed, and otherwise it just gives you the command's own exit value. Not opam's. The command's. periodt.
0β Success β¨ or, for boolean queries, true.1β False. It comes back when a boolean return value is expected, like when you're running with--check, or for queries such asopam lint.2β Bad command-line arguments π β or command-line arguments that point at an invalid context (say, a file that doesn't follow the expected format).5β Not found. You asked for something (a package, a version, a repository, whatever) and it genuinely isn't there. π10β Aborted. The operation needed confirmation, and confirmation was not given.15β Couldn't get the locks required for the operation. π20β No solution to what you asked for. Like, imagine requesting two incompatible packages β yeah, that. π30β Error in a package definition, or in other metadata files. Using--strictmakes this one show up way more often.31β Package script error. Some package operations were unsuccessful. Could be a problem in the packages themselves, or an incompatibility with your system. Heads up: this one can be a partial error.40β Sync error. Some remotes couldn't be fetched from the network. Also can be a partial error. π‘50β Configuration error. Opam or your system config doesn't allow the operation, and it needs fixing before you can move on.60β Solver failure. The solver couldn't return a sound answer. Could be a broken external solver, or an error in the solver configuration. π§ π₯99β Internal error. Something went wrong, and it's most likely a bug in opam itself. not opam catching strays, it said it itself.130β User interrupt.SIGINTwas received, which is generally what happens when you press Ctrl+C. π
and then there's this other little batch of codes, also just vibing here:
0β on success.123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs).
π FURTHER DOCUMENTATION π
the extra reading exists, bestie: https://opam.ocaml.org/doc</p> β go, read, slay. π
π AUTHORS π
okay so these are the actual legends who built this thing, give them their flowers fr fr π«ΆπΈ:
- David Allsopp
<david@tarides.com> - Vincent Bernardoff
<vb@luminar.eu.org> - Raja Boujbel
<raja.boujbel@ocamlpro.com> - 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 herself, obviously iykyk πβ¨
π BUGS π
found something cursed? the bug reports live at https://github.com/ocaml/opam/issues β go check 'em there, don't suffer in silence babe π
and that's a wrap on OPAM-INFO(1), brought to you by Opam 2.6.1 π go forth, read your exit codes, and remember: the vibe check is eternal π¦βπ
π¦ 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