OPAM-ADMIN-CHECK(1)

πŸ¦‹ opam admin-check πŸ¦‹

from the Opam admin Manual, section 1 πŸ’–

okay bestie, welcome to the glow-up of a genuinely iconic page. this one is long so hydrate first πŸ“


✨ NAME ✨

opam admin-check β€” Runs some consistency checks on a repository πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

opam admin check [OPTION]…

🌸 DESCRIPTION 🌸

okay so what this command does: it runs consistency checks on a repository, and then it prints a report to stdout. That's the whole vibe. 🫢

The checks it does include:

  • packages that are not installable β€” like, due to a missing dependency, that kind of situation 😭
  • dependency cycles β€” yes, the messy circular ones πŸ”„

Important detail bestie, do not skip this: the 'available' field is ignored for these checks. That is, all packages are supposed to be available. Like, we're just pretending everything's fine and testing the rest. πŸ™ˆ

And by default? all checks are run. no picking favourites, we do the full routine ✨


πŸ’… OPTIONS πŸ’…

  • --cycles β€” Do the cycles check (and disable the others by default). just the cycles, periodt πŸ”„
  • --installability β€” Do the installability check (and disable the others by default). will it install or will it flop, let's find out 🧚
  • --obsolete β€” Analyse for obsolete packages. finding the ones that have lowkey outlived their era πŸ’€
  • -s, --short β€” Only output a list of uninstallable packages. minimal effort, maximum info, we love a short king πŸ‘‘

πŸ‘‘ COMMON OPTIONS πŸ‘‘

These options are common to all commands. β€” yes, every single command gets these, they're the shared wardrobe πŸ’–

  • --best-effort β€” Don't fail if all requested packages can't be installed: try to install as many as possible. Note that not all external solvers may support this option (recent versions of aspcud or mccs should). This is equivalent to setting $OPAMBESTEFFORT environment variable. like, we tried our best and that counts 🫢
  • --cli=MAJOR.MINOR (absent=2.6) β€” Use the command-line interface syntax and semantics of MAJOR.MINOR. Intended for any persistent use of opam (scripts, blog posts, etc.), any version of opam in the same MAJOR series will behave as for the specified MINOR release. The flag was not available in opam 2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable to 2.0 instead of using this parameter. time travel but for CLI behaviour ⏳
  • --color=WHEN β€” Colorize the output. WHEN must be one of always, never or auto. we're doing colour theory now 🌈
  • --confirm-level=LEVEL β€” Confirmation level, LEVEL must be one of ask, no, yes or unsafe-yes. Can be specified more than once. If --yes or --no are also given, the value of the last --confirm-level is taken into account. This is equivalent to setting $OPAMCONFIRMLEVEL. last one wins, that's the rule βœ‹
  • --criteria=CRITERIA β€” Specify user preferences for dependency solving for this run. Overrides $OPAMCRITERIA, $OPAMFIXUPCRITERIA and $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. very demure, very mindful, very curated πŸŽ€
  • --cudf=FILENAME β€” Debug option: Save the CUDF requests sent to the solver to FILENAME-<n>.cudf where <n> is the n-th call to the solver during the opam run. iykyk, this one's for the debugging girlies πŸ”
  • --debug β€” Print debug message to stderr. This is equivalent to setting $OPAMDEBUG to "true". tell me everything, I want the whole story πŸ“’
  • --debug-level=LEVEL β€” Like --debug, but allows specifying the debug level (--debug sets it to 1). Equivalent to setting $OPAMDEBUG to a positive integer. debug but make it a slider 🎚️
  • --git-version β€” Print the git version of opam, if set (i.e. you are using a development version), and exit. showing off the dev build, iconic ⭐
  • --help[=FMT] (default=auto) β€” Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined. bestie needs help sometimes and that's fine 🫢
  • --ignore-pin-depends β€” Ignore extra pins required by packages that get pinned, either manually through opam pin or through opam install DIR. This is equivalent to setting IGNOREPINDEPENDS=true. no chain reactions today thank u πŸ™…
  • --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 $OPAMJSON variable. machine-readable receipts, we love documentation πŸ“„
  • --no β€” Answer no to all opam yes/no questions without prompting. See also --confirm-level. This is equivalent to setting $OPAMNO to "true". respectfully declining πŸ’…
  • --no-aspcud β€” Removed in 2.1. gone, retired, no longer with us, rip πŸͺ¦
  • --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 this 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 using opam admin upgrade [--mirror URL] when possible. do it the tidy way if you can, bestie 🧹
  • -q, --quiet β€” Disables --verbose. shhh, girlies are focusing 🀫
  • --root=ROOT β€” Use ROOT as the current root path. This is equivalent to setting $OPAMROOT to ROOT. pick your home base 🏠
  • --safe, --readonly β€” 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. This is equivalent to set environment variable $OPAMSAFE. look don't touch mode, we respect boundaries βœ‹πŸ’–
  • --solver=CMD β€” Specify the CUDF solver to use for resolving package installation problems. This is either a predefined solver (this version of opam supports builtin-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. choose your fighter πŸ₯Š
  • --strict β€” Fail whenever an error is found in a package definition or a configuration file. The default is to continue silently if possible. no notes, no mercy 😀
  • --switch=SWITCH β€” Use SWITCH as the current compiler switch. This is equivalent to setting $OPAMSWITCH to SWITCH. switching it up, as one does πŸ¦‹
  • --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 $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER. home-grown, artisanal, locally sourced ✨
  • -v, --verbose β€” Be more verbose. One -v shows all package commands, repeat to also display commands called internally (e.g. tar, curl, patch etc.) Repeating n times is equivalent to setting $OPAMVERBOSE to "n". one v is chatting, three v's is a whole podcast πŸŽ™οΈ
  • --version β€” Show version information. the classic. mandatory. iconic πŸ‘‘
  • -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. heads up: if the dir is messy, the build might just break on you 😭
  • -y, --yes β€” Answer yes to all opam yes/no questions without prompting. See also --confirm-level. This is equivalent to setting $OPAMYES to "true". consent but pre-approved, slay πŸ’–

🌈 still with me? good. more parts coming, don't go anywhere bestie. 🌈

🌸 ENVIRONMENT 🌸

okay bestie, opam is very into environment variables, and this is the whole roster. before we dive in, the rules of the game:

Boolean variables should be set to "0", "no", "false" or the empty string to disable, and "1", "yes" or "true" to enable. that's it, that's the whole grammar πŸ’…


  • OPAMALLPARENS β€” surround all filters with parenthesis. yes, all of them. every single one 🫢
  • OPAMASSUMEDEPEXTS β€” see the option --assume-depexts.
  • OPAMAUTOANSWER β€” internal use only, bestie. not for you, not for me, not for anyone's script. πŸ™ˆ
  • OPAMAUTOREMOVE β€” see the remove option --auto-remove.
  • OPAMBESTEFFORT β€” see the 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 the opam-query property in the solution.
  • OPAMBUILDDOC β€” Removed in 2.1. it's giving ghost of opam past πŸ’€
  • OPAMBUILDTEST β€” Removed in 2.1. same vibe, also deceased.
  • OPAMCLI β€” see the option --cli.
  • OPAMCOLOR β€” when set to always or never, sets a default value for the --color option.
  • OPAMCONFIRMLEVEL β€” see the option --confirm-level. heads up: OPAMCONFIRMLEVEL has priority over OPAMYES and OPAMNO. it's the main character here, no cap πŸ‘‘
  • OPAMCRITERIA β€” specifies user preferences for dependency solving. the default value depends on the solver version, so run config report to find out the current setting. see also the 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. see OPAMFETCH for more options.
  • OPAMDEBUG β€” see the 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:2 or CLIENT 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-dir on update. without this variable set, opam would keep them unchanged unless they're explicitly named on the command-line.
  • OPAMDRYRUN β€” see the option --dry-run.
  • OPAMEDITOR β€” sets the editor to use for opam file editing, and it overrides $EDITOR and $VISUAL. it said "move, I'm the editor now" ✨
  • OPAMERRLOGLEN β€” sets the number of log lines printed when a sub-process fails. 0 to print all of them. all of them. buckle up 😭
  • OPAMEXTERNALSOLVER β€” see the option --solver.
  • OPAMFAKE β€” see the option --fake.
  • OPAMFETCH β€” specifies how to download files: either wget, 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 as OPAMUPGRADECRITERIA, but specific to fixup and reinstall.
  • OPAMIGNOREAVAILABLE β€” see the install option --ignore-available-on.
  • OPAMIGNORECONSTRAINTS β€” see the install option --ignore-constraints-on.
  • OPAMIGNOREPINDEPENDS β€” see the option --ignore-pin-depends.
  • OPAMINPLACEBUILD β€” see the option --inplace-build.
  • OPAMJOBS β€” sets the maximum number of parallel workers to run. workers!! plural!! multitasking queen 🧚
  • 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 to get more reliable backtraces.
  • OPAMLOCKED β€” a combination of the --locked and --lock-suffix options.
  • OPAMLOGS β€” logdir sets the 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 the options --no and --confirm-level. but listen: OPAMNO is ignored if either OPAMCONFIRMLEVEL or OPAMYES is set. it's not the boss of this situation πŸ’€
  • OPAMNOAGGREGATE β€” with opam admin check, don't aggregate packages.
  • OPAMNOASPCUD β€” Deprecated. we don't use it, ok? 🫢
  • OPAMNOAUTOUPGRADE β€” disables automatic internal upgrade of repositories in an earlier format to the current one, on update or init.
  • OPAMNOCHECKSUMS β€” enables the option --no-checksums when available.
  • OPAMNODEPEXTS β€” disables system dependencies handling, see the option --no-depexts.
  • OPAMNOENVNOTICE β€” Internal. not yours, not mine πŸ™ˆ
  • OPAMNOSELFUPGRADE β€” see the 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. it's less efficient, but it might help when you're debugging a solver issue.
  • 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, with no I/O for scanning the repository. iconic behaviour honestly πŸŽ€
  • OPAMREQUIRECHECKSUMS β€” enables the option --require-checksums when available (e.g. for opam install).
  • OPAMRETRIES β€” sets the number of tries before failing downloads.
  • OPAMREUSEBUILDDIR β€” see the option --reuse-build-dir.
  • OPAMROOT β€” see the option --root. this is automatically set by opam env --root=DIR --set-root.
  • OPAMROOTISOK β€” don't complain when running as root.
  • OPAMSAFE β€” see the option --safe.
  • OPAMSHOW β€” see the option --show.
  • OPAMSKIPUPDATE β€” see the option --skip-updates.
  • OPAMSKIPVERSIONCHECKS β€” bypasses some version checks. Unsafe, for compatibility testing only. like, actually unsafe, bestie, don't just vibe with it at home.
  • OPAMSOLVERALLOWSUBOPTIMAL β€” (default true) 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. if true, opam will continue with a warning; if false, a timeout is an error. currently only the builtin-z3 backend handles this degraded case.
  • OPAMSOLVERTIMEOUT β€” change the time allowance of the solver. default is 60.0, set to 0 for 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 from 0.0 (best solution known to the solver) to 1.0 (unoptimized solution). default is 0.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. RIP gorgeous πŸ’€
  • OPAMSTATUSLINE β€” display a dynamic status line showing what's currently going on on the terminal. (one of always, never or auto)
  • OPAMSTRICT β€” fail on inconsistencies (file reading, switch import, etc.). it's giving strict parent energy, but it's for your own good ✨
  • OPAMSWITCH β€” see the option --switch. automatically set by opam env --switch=SWITCH --set-switch.
  • OPAMUNLOCKBASE β€” see the install option --unlock-base.
  • OPAMUPGRADECRITERIA β€” specifies user preferences for dependency solving when performing an upgrade. overrides OPAMCRITERIA in upgrades if both are set. see also the option --criteria.
  • OPAMUSEINTERNALSOLVER β€” see the option --use-internal-solver.
  • OPAMUSEOPENSSL β€” Removed in 2.2. gone, bye, we don't know her πŸ™ˆ
  • OPAMUTF8 β€” use UTF8 characters in output (one of always, never or auto). by default auto, which is determined from the locale.
  • OPAMUTF8MSGS β€” use extended UTF8 characters (camels) in opam messages. implies OPAMUTF8. this is set by default on macOS only. camels!!! πŸͺ adorable.
  • OPAMVALIDATIONHOOK β€” if set, uses the %{hook}% command to validate an opam repository update.
  • OPAMVERBOSE β€” see the option --verbose.
  • OPAMVERBOSEON β€” see the option --verbose-on.
  • OPAMVERSIONLAGPOWER β€” do not use. that's the whole description. do not use. πŸ’€
  • OPAMWITHDEVSETUP β€” see the install option --with-dev-setup.
  • OPAMWITHDOC β€” see the install option --with-doc.
  • OPAMWITHTEST β€” see the install option --with-test.
  • OPAMWORKINGDIR β€” see the option --working-dir.
  • OPAMYES β€” see the options --yes and --confirm-level. OPAMYES has priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
  • 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.

✨ CLI VERSION ✨

okay so this part is genuinely important, bestie, don't skip 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. additionally, blog posts or other documentation can benefit from this, because it prevents information from becoming stale. your tutorial from 2019 stays valid forever, slay.

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 (as 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. so like, it will drag you a little bit if you do it the weird way πŸ’…

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 β€” last one wins, periodt πŸ‘‘ OPAMCLI is only inspected if --cli is not given.

πŸ’€ EXIT STATUS πŸ’€

Okay bestie, this is the part where you screenshot and save it, because opam is very into exit codes and each number is telling you a whole story. πŸ”’βœ¨

One plot twist first: the exec command is the exception to literally everything below πŸ‘‡ it returns 127 if the command wasn't found or couldn't be executed, and otherwise it returns the command's own exit value. Not opam's opinion. The command's. 🫑
  • 0 β€” Success! Or true for boolean queries. We love a green flag πŸ’š
  • 1 β€” False. This is what you get when a boolean return value is expected, like when you're running with --check, or for queries like opam lint. It's not an error, it's just a no πŸ™…β€β™€οΈ
  • 2 β€” Bad command-line arguments, or command-line arguments pointing at an invalid context (think: a file that doesn't follow the expected format). Reread what you typed, bestie πŸ“
  • 5 β€” Not found. You asked for something β€” a package, a version, a repository, etc. β€” and it simply does not exist. Ghosted by your own toolchain πŸ‘»
  • 10 β€” Aborted. The operation needed confirmation and you didn't give it. It was waiting on you and you left it on read 😭
  • 15 β€” Could not acquire the locks required for the operation. Something else is holding the door πŸ”’
  • 20 β€” There is no solution to the user request. Lowkey this can happen when you ask to install two incompatible packages, for example πŸ’€
  • 30 β€” Error in package definition, or other metadata files. And heads up β€” using --strict raises 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. Note: this can be a partial error.
  • 40 β€” Sync error. Could not fetch some remotes from the network. Also allowed to be a partial error 🌐
  • 50 β€” Configuration error. Opam or system configuration doesn't allow the operation, and it needs fixing before you can move on πŸ› οΈ
  • 60 β€” Solver failure. The solver failed to return a sound answer. Could 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 you. It's them. πŸͺ²
  • 130 β€” User interrupt. SIGINT was received, generally because the user pressed Ctrl+C. That was you. It's okay 🫢
  • 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 πŸ“š

Need more? The docs live at https://opam.ocaml.org/doc. Go read, you'll eat it up πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

Look at this absolute roster, a whole friend group carrying opam on their backs πŸ«ΆπŸ’–

  • 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 admin(1) β€” go read this one too, it's the sibling ✨

πŸ› BUGS πŸ›

Found something cursed? Check the bug reports at https://github.com/ocaml/opam/issues. Reporting is a public service and it's iconic of you 🫑



That's the whole page, bestie β€” this is Opam admin version 2.6.1, aka the OPAM ADMIN-CHECK(1) manual page. You read the entire thing and you understood it. Main character energy, no cap. Go forth and exit code with confidence πŸŽ€πŸ’œ

πŸ“¦ where this page comes from