OPAM-ADMIN-LIST(1)
๐ opam admin-list โ the Opam admin Manual girlies know ๐
okay so bestie, welcome to opam admin-list, straight outta the Opam admin manual โจ this one is literally the vibe check for a repo. let's get into it ๐ซถ
๐ธ NAME ๐ธ
opam admin-list โ lists packages from a repository ๐ฆโจ
๐ SYNOPSIS ๐
opam admin list [--environment=VAR=VALUE[,VAR=VALUE]] [OPTION]โฆ
[PATTERNS]โฆ
๐ฆ DESCRIPTION ๐ฆ
so this command is giving major opam list energy, right? but the plot twist is that it lists packages directly from a repository instead of whatever's chillin' in a given opam installation. no cap. it's the repo version of the thing you already know and love ๐ญ๐
๐ ARGUMENTS ๐
PATTERNSโ package patterns, but make it globs ๐ซง they match againstNAMEorNAME.VERSION. yes bestie, globs. it's giving flexible โจ
๐ OPTIONS ๐
--environment=VAR=VALUE[,VAR=VALUE]โ use the given opam environment, in the form of a list of comma-separatedvar=valuebindings, when resolving variables ๐ this gets used e.g. when it's computing available packages: if it's undefined, availability of packages will be assumed as soon as it can't be resolved purely from globally defined variables. lowkey important. also bestie, heads up: unless you override them, variables likerootoropam-versionmay be taken from the current opam installation ๐ and what's defined in~/.opam/configis always ignored. yes, always. periodt ๐ โ๏ธ
๐ ORDER-SENSIBLE SELECTORS ๐
okay so these options are sensible to the order you give them to the command ๐ like, the order matters. for example: --available --latests-only will first list all the available packages, then choose only the latest packages in that set; while --latests-only --available will first list all the latest packages, then only show the ones that are available in that set ๐ซ so yeah. order = everything. iykyk.
-a,--availableโ list only packages that are available according to the defined environment โ without--environment, this will include any packages for which availability is not resolvable at this point ๐-A,--allโ include all, even uninstalled or unavailable packages ๐ all of them. the whole guest list.--installableโ list only packages that are installable according to the defined environment ๐ ๏ธ (this calls the solver and may be more costly โ a package depending on an unavailable one may be available, but is never installable ๐ญ)--latests-onlyโ list only the latest version of each package โญ just the freshest one, bestie.
๐ง PACKAGE SELECTION OPTIONS ๐ง
these options will always be given to the command in the same order, no matter what order you typed them in ๐ซถ it's giving "we don't do chaos here."
--coinstallable-with=PACKAGESโ only list packages that are compatible with all ofPACKAGES๐ค group project but everyone actually gets along.--conflicts-with=PACKAGESโ list packages that have declared conflicts with at least one of the given list ๐ฅ this includes conflicts defined from the packages in the list, from the other package, or by a commonconflict-class:field. messy, but documented.--depends-on=PACKAGESโ list only packages that depend on one of (comma-separated)PACKAGES๐--depoptsโ include optional dependencies in dependency requests ๐--devโ include development packages in dependencies ๐ฉ๐ป--field-match=FIELD:PATTERNโ filter packages with a match forPATTERNon the givenFIELD๐--has-flag=FLAGโ only include packages which have the given flag set ๐ฉ package flags are one of:light-uninstallverboseplugincompilerconf--has-tag=TAGโ only includes packages which have the given tag set ๐ท๏ธ--nobuildโ exclude build dependencies (they are included by default) ๐ โ๏ธ--orโ instead of selecting packages that match all the criteria, select packages that match any of them ๐ either/or energy.--postโ include dependencies tagged as post ๐ฎ--recursiveโ with--depends-onand--required-by, display all transitive dependencies rather than just direct dependencies ๐ it goes deep.--required-by=PACKAGESโ list only the dependencies of (comma-separated)PACKAGES๐ฅ--resolve=PACKAGESโ restrict to a solution to install (comma-separated)PACKAGES, i.e. a consistent set of packages including those ๐งฉ this is subtly different from--required-by --recursive, which is more predictable and can't fail, but lists all dependencies independently without ensuring consistency. without--installed, the answer is self-contained and independent of the current installation; with--installed, it's computed from the set of currently installed packages.--no-switchfurther makes the solution independent from the currently pinned packages, architecture, and compiler version. the combination with--depoptsis not supported ๐ซ bestie don't do it.-t,--with-test,--testโ include test-only dependencies ๐งช--with-dev-setupโ include developer only dependencies ๐ ๏ธ--with-doc,--docโ include doc-only dependencies ๐
โจ OUTPUT FORMAT OPTIONS โจ
--columns=COLUMNSโ select the columns to display among:name,version,package,synopsis,synopsis-or-target,description,<field>:,installed-version,pin,source-hash,opam-file,all-installed-versions,available-versions,all-versions,repository,installed-files,vc-ref,depexts๐๏ธ the special form<field>:(field name followed by colon, e.g.,license:) selects an arbitrary field. the default isnamewhen--shortis present andname, installed-version, synopsis-or-targetotherwise ๐--normaliseโ print the values of opam fields normalised ๐-S,--sortโ sort the packages in dependency order (i.e. an order in which they could be individually installed.) ๐ข chef's kiss ordering.-s,--shortโ don't print a header, and sets the default columns tonameonly ๐ซง if you need package versions included, use--columns=packageinstead.--separator=STRING(absent=) โ set the column-separator string ๐ yes it defaults to a literal space, iconic.-V,--all-versionsโ normally, when multiple versions of a package match, only one is shown in the output (the installed one, the pinned-to one, or, failing that, the highest one available or the highest one). this flag disables this behaviour and shows all matching versions. this also changes the default display format to include package versions instead of just package names (including when--shortis set). this is automatically turned on when a single non-pattern package name is provided on the command-line ๐--wrapโ wrap long lines, the default being to truncate when displaying on a terminal, or to keep as is otherwise ๐งป
okay bestie we're not done yet, there's more coming โ stay tuned ๐
๐ COMMON OPTIONS ๐
okay bestie, these are the ones every single opam command shares, so likeโฆ learn them once, slay forever. โจ
--best-effortโ don't be dramatic if not every package you asked for can actually be installed: just try to install as many as possible instead of rage-quitting. lowkey important: not all external solvers support this (recent versions ofaspcudormccsshould tho). Totally equivalent to setting the$OPAMBESTEFFORTenvironment variable. ๐ซถ--cli=MAJOR.MINOR(absent=2.6) โ use the command-line interface syntax and semantics ofMAJOR.MINOR. It's giving "for any persistent use of opam" (scripts, blog posts, etc.) โ any version of opam in the sameMAJORseries will behave as for the specifiedMINORrelease. ๐ Heads up: this 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 ๐ .WHENmust be one ofalways,neverorauto.--confirm-level=LEVELโ the confirmation level, andLEVELmust be one ofask,no,yesorunsafe-yes. Can be specified more than once (yes, more than once, icon). If--yesor--noare also given, the value of the last--confirm-levelis taken into account. Equivalent to setting$OPAMCONFIRMLEVEL. โญ--criteria=CRITERIAโ specify user preferences for dependency solving for this run. Overrides$OPAMCRITERIA,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. For details on the supported language, and the external solvers available, see http://opam.ocaml.org/doc/External_solvers.html. A general guide to using solver preferences can be found at http://www.dicosmo.org/Articles/usercriteria.pdf. ๐--cudf=FILENAMEโ debug option, bestie: save the CUDF requests sent to the solver toFILENAME-<n>.cudf, where<n>is the n-th call to the solver during the opam run. ๐--debugโ print debug message tostderr. Equivalent to setting$OPAMDEBUGto"true".--debug-level=LEVELโ like--debug, but allows specifying the debug level (--debugsets it to1). Equivalent to setting$OPAMDEBUGto a positive integer.--git-versionโ print the git version of opam, if set (i.e. you are 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 extra pins required by packages that get pinned, either 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 will 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. ๐ gone, girl, it's not coming back.--no-auto-upgradeโ when configuring or updating a repository that is 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 will 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. ๐ง-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. Will fail whenever such an operation is needed ; also avoids waiting for locks, skips interactive questions and overrides the$OPAMDEBUGvariable. This is equivalent to set 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. no cap, strict mode does not play.--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, repeat to also display 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 are pointing to. As source directory is copied as it is, if it isn't clean it may result on a 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 bestie so opam is very into environment variables, and here's the whole roster. Boolean variables? Set them to "0", "no", "false" or the empty string to turn them OFF, and "1", "yes" or "true" to turn them ON. That's the rules, no cap. ๐
OPAMALLPARENSโ surround all filters with parenthesis. yeah. all of them.OPAMASSUMEDEPEXTSโ see option--assume-depexts.OPAMAUTOANSWERโ internal use only. nothing to see here, move along ๐ซฃOPAMAUTOREMOVEโ see the remove option--auto-remove.OPAMBESTEFFORTโ see option--best-effort.OPAMBESTEFFORTPREFIXCRITERIAโ sets the string that must be prepended to the criteria when the--best-effortoption is set, and it's expected to maximise theopam-queryproperty in the solution.OPAMBUILDDOCโ Removed in 2.1. ๐ gone and not coming back.OPAMBUILDTESTโ Removed in 2.1. also gone bestie.OPAMCLIโ see option--cli.OPAMCOLORโ when set toalwaysornever, sets a default value for the--coloroption.OPAMCONFIRMLEVELโ see option--confirm-level. and heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO. she's the main character here โจOPAMCRITERIAโ specifies user preferences for dependency solving. the default value depends on the solver version, so useconfig reportto know the current setting. also see 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 givencurlprogram. seeOPAMFETCHfor more options.OPAMDEBUGโ see options--debugand--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.OPAMDROPWORKINGDIRโ overrides packages previously updated with--working-diron update. without this variable set, opam would keep them unchanged unless explicitly named on the command-line.OPAMDRYRUNโ see option--dry-run.OPAMEDITORโ sets the editor to use for opam file editing, overriding$EDITORand$VISUAL. she said my editor now ๐OPAMERRLOGLENโ sets the number of log lines printed when a sub-process fails.0to print all.OPAMEXTERNALSOLVERโ see option--solver.OPAMFAKEโ see option--fake.OPAMFETCHโ specifies how to download files: eitherwget,curlor a custom command where 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.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 maximum number of parallel workers to run.OPAMJSONโ log json output to the given file (use 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 to get more reliable backtraces.OPAMLOCKEDโ combination of--lockedand--lock-suffixoptions.OPAMLOGSโ logdir sets 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.OPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set.OPAMNOAGGREGATEโ withopam admin check, don't aggregate packages.OPAMNOASPCUDโ Deprecated. ๐ฉ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-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 to false to disable CUDF preprocessing. less efficient, but might help debugging solver issues.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.OPAMSKIPUPDATEโ see option--skip-updates.OPAMSKIPVERSIONCHECKSโ bypasses some version checks. Unsafe, for compatibility testing only. fr fr be careful.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. ๐OPAMSTATUSLINEโ display a dynamic status line showing what's currently going on on the terminal. (one ofalways,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. 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 (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. ๐ช iconic honestlyOPAMVALIDATIONHOOKโ 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 bestie ๐ญ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 variablevarwhen substituting%{var}%strings inopamfiles.OPAMVAR_package_varโ overrides the contents of the variablepackage:varwhen substituting%{package:var}%strings inopamfiles.
๐ฆ CLI VERSION ๐ฆ
okay so listen, this part is IMPORTANT and honestly kinda iconic:
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. additionally, blog posts or other documentation can benefit, because it prevents information from becoming stale. future-proofing is self-care โจ
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 (because opam 2.0 will just ignore it), and --cli=2.1 for 2.1 (or later) versions โ since 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 watching.
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. last one wins, always. periodt. ๐
๐ EXIT STATUS ๐
okay bestie, big exception first, write it down: the exec command does NOT play by these rules. if the command wasn't found or couldn't be executed, it returns 127, and otherwise it returns the command's own exit value. that's it, that's the exception, don't forget it ๐
everyone else? here's the tea:
0โ Success, or true for boolean queries. living your best life โจ1โ False. Comes back when a boolean return value is expected, like when you're running with--check, or for queries likeopam lint. it's not an error, it's just a "no" ๐ซถ2โ Bad command-line arguments, or arguments pointing to an invalid context (say, a file that doesn't follow the expected format). typo era ๐ญ5โ Not found. You asked for something (package, version, repository, etc.) and it is simply not there. it's giving ghosted ๐ป10โ Aborted. The operation needed confirmation and you didn't give it.15โ Could not acquire the locks required for the operation. ๐ someone else is in there20โ There is no solution to the user request. this can happen when you ask to install two incompatible packages, for example. the math said no ๐30โ Error in package definition, or other metadata files. heads up: 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. and it can be a partial error, so like, some of it worked ๐ฅ40โ Sync error. Could not fetch some remotes from the network. also can be a partial error ๐ซ50โ Configuration error. Opam or system configuration doesn't allow the operation and needs fixing. it's not you, it's the config ๐60โ Solver failure. The solver failed to return a sound answer. can be a broken external solver, or an error in solver configuration.99โ Internal error. Something went wrong, likely due to a bug in opam itself. not us, it's the algorithm ๐130โ User interrupt.SIGINTwas received, generally because the user pressed Ctrl-C. iconic rage quit โ
and then there's this next little set, right after:
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 lore continues at https://opam.ocaml.org/doc โ go read, bestie, there's so much more where this came from ๐
๐ AUTHORS ๐
the absolute legends who made this happen, no cap, show some respect:
- 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>
main character energy, every single one ๐
๐ฆ SEE ALSO ๐ฆ
opam admin(1)โ the whole fam, iykyk
๐ BUGS ๐
found something cursed? check the bug reports at https://github.com/ocaml/opam/issues. they wanna know, fr fr ๐ซถ
and that's a wrap on the whole page, bestie ๐ this was Opam admin 2.6.1, the OPAM ADMIN-LIST(1) page โ version 2.6.1 and its date info are the very last things on the page, so consider this your cute little sign-off instead of that boring footer line. go forth and opam admin list responsibly โจ๐
๐ฆ 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