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 ofaspcudormccsshould). This is equivalent to setting$OPAMBESTEFFORTenvironment variable. like, we tried our best and that counts π«Ά--cli=MAJOR.MINOR(absent=2.6) β Use the command-line interface syntax and semantics ofMAJOR.MINOR. Intended for any persistent use of opam (scripts, blog posts, etc.), any version of opam in the sameMAJORseries will behave as for the specifiedMINORrelease. The flag was not available in opam2.0, so to select the2.0CLI, set theOPAMCLIenvironment variable to2.0instead of using this parameter. time travel but for CLI behaviour β³--color=WHENβ Colorize the output.WHENmust be one ofalways,neverorauto. we're doing colour theory now π--confirm-level=LEVELβ Confirmation level,LEVELmust be one ofask,no,yesorunsafe-yes. Can be specified more than once. If--yesor--noare also given, the value of the last--confirm-levelis 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,$OPAMFIXUPCRITERIAand$OPAMUPGRADECRITERIA. For details on the supported language, and the external solvers available, seehttp://opam.ocaml.org/doc/External_solvers.html. A general guide to using solver preferences can be found athttp://www.dicosmo.org/Articles/usercriteria.pdf. very demure, very mindful, very curated π--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. iykyk, this one's for the debugging girlies π--debugβ Print debug message to stderr. This is equivalent to setting$OPAMDEBUGto"true". tell me everything, I want the whole story π’--debug-level=LEVELβ Like--debug, but allows specifying the debug level (--debugsets it to1). Equivalent to setting$OPAMDEBUGto 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 formatFMT. The valueFMTmust be one ofauto,pager,grofforplain. Withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined. bestie needs help sometimes and that's fine π«Ά--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. 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$OPAMJSONvariable. 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$OPAMNOto"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 usingopam 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β UseROOTas the current root path. This is equivalent to setting$OPAMROOTtoROOT. 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$OPAMDEBUGvariable. 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 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. 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β UseSWITCHas the current compiler switch. This is equivalent to setting$OPAMSWITCHtoSWITCH. 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$OPAMNOASPCUDor$OPAMUSEINTERNALSOLVER. home-grown, artisanal, locally sourced β¨-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". 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$OPAMYESto"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 theremoveoption--auto-remove.OPAMBESTEFFORTβ see the option--best-effort.OPAMBESTEFFORTPREFIXCRITERIAβ sets the string that must be prepended to the criteria when the--best-effortoption is set, and is expected to maximise theopam-queryproperty 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 toalwaysornever, sets a default value for the--coloroption.OPAMCONFIRMLEVELβ see the option--confirm-level. heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNO. it's the main character here, no cap πOPAMCRITERIAβ specifies user preferences for dependency solving. the default value depends on the solver version, so runconfig reportto find out the current setting. see also the option--criteria.OPAMCUDFFILEβ save the cudf graph tofile-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 the 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-dironupdate. 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$EDITORand$VISUAL. it said "move, I'm the editor now" β¨OPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails.0to 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: eitherwget,curlor a custom command where the variables%{url}%,%{out}%,%{retry}%,%{compress}%and%{checksum}%will be replaced. overrides thedownload-commandvalue from the main config file.OPAMFIXUPCRITERIAβ same asOPAMUPGRADECRITERIA, but specific to fixup and reinstall.OPAMIGNOREAVAILABLEβ see theinstalloption--ignore-available-on.OPAMIGNORECONSTRAINTSβ see theinstalloption--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 theinstalloption--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--lockedand--lock-suffixoptions.OPAMLOGSβlogdirsets the log directory, default is a temporary directory in/tmp.OPAMMAKECMDβ set the systemmakecommand to use.OPAMMERGEOUTβ merge process outputs, stderr on stdout.OPAMNOβ answer no to any question asked, see the options--noand--confirm-level. but listen:OPAMNOis ignored if eitherOPAMCONFIRMLEVELorOPAMYESis set. it's not the boss of this situation πOPAMNOAGGREGATEβ withopam 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, onupdateorinit.OPAMNOCHECKSUMSβ enables the option--no-checksumswhen 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 tofalseto 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 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, with no I/O for scanning the repository. iconic behaviour honestly πOPAMREQUIRECHECKSUMSβ enables the option--require-checksumswhen available (e.g. foropam 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 byopam 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β (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 thebuiltin-z3backend 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. it 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. RIP gorgeous π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.). it's giving strict parent energy, but it's for your own good β¨OPAMSWITCHβ see the option--switch. automatically set byopam env --switch=SWITCH --set-switch.OPAMUNLOCKBASEβ see theinstalloption--unlock-base.OPAMUPGRADECRITERIAβ specifies user preferences for dependency solving when performing an upgrade. overridesOPAMCRITERIAin 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 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. 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 theinstalloption--with-dev-setup.OPAMWITHDOCβ see theinstalloption--with-doc.OPAMWITHTESTβ see theinstalloption--with-test.OPAMWORKINGDIRβ see the option--working-dir.OPAMYESβ see the 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 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: theexeccommand is the exception to literally everything below π it returns127if 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! Ortruefor 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 likeopam 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--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. 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.SIGINTwas 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
- 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