OPAM-REMOTE(1)
π OPAM-REMOTE π
okay bestie, welcome to the opam-remote page β this is part of the Opam Manual, and no, it is not going to be boring, we are going to have a whole moment with it π
β¨ NAME β¨
opam-remote β it's literally just an alias for repository. that's it. that's the whole name section. iconic of it honestly π
πΈ SYNOPSIS πΈ
opam remote [--kind=KIND] [--rank=RANK] [--short] [OPTION]β¦ [COMMAND]
[ARG]β¦
π¦ DESCRIPTION π¦
opam remote is an alias for opam repository. they're the same girl, different name tag π
so like, if you want the actual deets? run opam repository --help. that's where the details live. this page is basically the sparkly shortcut β¨
π SCOPE SPECIFICATION OPTIONS π
this is the part where you tell opam which selections you're acting on. very "who is this about" energy π«Ά
-a,--all-switchesβ act on the selections of all configured switches. all of them. every single one π€--dont-selectβ don't update any selections. we're just looking, not touching π--on-switches=SWITCHESβ act on the selections of the given list of switches. you nominate the switches, opam does the thing π--set-defaultβ act on the default repository selection, the one that gets used for newly created switches. this is the "for future me" option π--this-switchβ act on the selections for the current switch. and yes bestie, this one is the default β you don't have to say it, it's already happening β¨
π OPTIONS π
-k KIND,--kind=KINDβ specify the kind of repository to be used.KINDhas to be one ofhttp,local,git,darcsorhg. pick your fighter π--rank=RANK(absent=1) β set the rank of the repository in the list of configured repositories. so here's the tea: package definitions are looked for in the repositories in increasing rank order, which means1is the highest priority π. negative ints can be used to select from the lowest priority, with-1being last. (set-reposcan otherwise be used to explicitly set the repository list at once.)-s,--shortβ output raw lists of names, one per line, skipping any details. just names. no extra commentary. we love a minimal queen π
β COMMON OPTIONS β
these ones are common to all commands, so they show up everywhere like that one friend who's at every party π«Ά
--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 the$OPAMBESTEFFORTenvironment variable πΈ--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. heads up: the flag was not 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β 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β--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π₯--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 π--debugβ print debug message to stderr. this is 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. it's gone bestie, 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 this behaviour. note that repositories should define their format version in arepofile 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 πΈ--no-self-upgradeβ opam will replace itself with a newer binary found atOPAMROOT/opamif present. this disables this behaviour π-q,--quietβ disables--verboseπ€«--root=ROOTβ useROOTas the current root path. this is equivalent to setting$OPAMROOTtoROOTπ³--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π‘οΈ--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, 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"π
okay that's part one bestie, hold on, there's more coming π
πΈ ENVIRONMENT πΈ
okay bestie, this is the part where opam lets you whisper into its ear before you even type a command π opam peeks at the environment variables listed down below, and honestly? there are like a lot of them, so buckle up.
π quick note on booleans: set them to"0","no","false"or just the empty string to disable, and"1","yes"or"true"to enable. That's it, that's the system π
OPAMALLPARENSβ wraps all filters in parenthesis. all of them. periodt.OPAMASSUMEDEPEXTSβ see the option--assume-depexts.OPAMAUTOANSWERβ internal use only π don't touch, it's not for you.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-effortoption is set, and it's expected to maximise theopam-queryproperty in the solution β¨OPAMBUILDDOCβ π Removed in 2.1.OPAMBUILDTESTβ π Removed in 2.1.OPAMCLIβ see the option--cli.OPAMCOLORβ when set toalwaysornever, it sets a default value for the--coloroption π¨OPAMCONFIRMLEVELβ see the option--confirm-level. Heads up:OPAMCONFIRMLEVELhas priority overOPAMYESandOPAMNOπOPAMCRITERIAβ specifies user preferences for dependency solving. The default value depends on the solver version, so useconfig reportto find out the current setting. See also the option--criteria.OPAMCUDFFILEβ saves 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 it uses--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 they're explicitly named on the command-line.OPAMDRYRUNβ see the option--dry-run.OPAMEDITORβ sets the editor to use for opam file editing. It overrides$EDITORand$VISUALπOPAMERRLOGLENβ sets the number of log lines printed when a sub-process fails.0prints all of them.OPAMEXTERNALSOLVERβ see the option--solver.OPAMFAKEβ see the 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. This overrides thedownload-commandvalue 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 the option--ignore-pin-depends.OPAMINPLACEBUILDβ see the option--inplace-build.OPAMJOBSβ sets the maximum 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 to get more reliable backtraces πOPAMLOCKEDβ a combination of the--lockedand--lock-suffixoptions.OPAMLOGSβ logdir sets the log directory, the default is a temporary directory in/tmpOPAMMAKECMDβ set the systemmakecommand to use.OPAMMERGEOUTβ merge process outputs, with stderr on stdout.OPAMNOβ answers no to any question asked, see the options--noand--confirm-level.OPAMNOis 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 the option--no-checksumswhen available.OPAMNODEPEXTSβ disables system dependencies handling, see the option--no-depexts.OPAMNOENVNOTICEβ Internal.OPAMNOSELFUPGRADEβ see the 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 tofalseto disable CUDF preprocessing. It's less efficient, but it might help debugging solver issues π§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.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 β οΈ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 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 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 the 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 the option--criteria.OPAMUSEINTERNALSOLVERβ see the option--use-internal-solver.OPAMUSEOPENSSLβ π Removed in 2.2.OPAMUTF8β use UTF8 characters in output (one ofalways,neverorauto). By default it'sauto, which is determined from the locale πOPAMUTF8MSGSβ use extended UTF8 characters (camels πͺ) in opam messages. It impliesOPAMUTF8. This is set by default on macOS only.OPAMVALIDATIONHOOKβ if set, uses the%{hook%}command to validate an opam repository update.OPAMVERBOSEβ see the option--verbose.OPAMVERBOSEONβ see the option--verbose-onOPAMVERSIONLAGPOWERβ do not use π like, genuinely, do not.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--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 here's the tea β every script and every programmatic invocation of opam should use --cli, so that everything keeps working seamlessly with future versions of the opam client. And it's not just for code β blog posts and other documentation get the glow-up too, because it stops the info from going stale πβ¨
Now, even though opam only supports roots (~/.opam/) for the current version, it does provide backwards compatibility for its command-line interface. Slay.
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 use --cli=2.1 for 2.1 (or later) versions β because an environment variable controlling the parsing of syntax is brittle. To that 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, and in that case the last instance takes precedence π
OPAMCLI is only inspected if --cli is not given.
π EXIT STATUS π
okay bestie, so exit codes are literally the receipts of what just happened. but FIRST, one iconic exception you need to know:
execdoes not follow the codes below. nope. theexeccommand returns127if the command wasn't found or couldn't be executed, and otherwise it just hands you back the command's own exit value. periodt. π
so here's the whole menu of what opam can throw at you:
0β Success! ortruefor boolean queries. slay, we love a happy ending. β¨1β False. this one shows up when a boolean return value is expected, like when you're running with--check, or for queries likeopam lint. it's not a fail, it's just a "no ma'am". π2β Bad command-line arguments, or command-line arguments pointing to an invalid context (e.g. a file not following the expected format). check ur syntax babes. π5β Not found. you asked for something β package, version, repository, whatever β and it simply could not be found. it's giving ghosted. π»10β Aborted. the operation needed confirmation and you didn't give it. so it left. πͺ15β Could not acquire the locks required for the operation. locks are held, you wait. take a seat. πͺ20β There is no solution to the user request. this can happen if you're asking to install two incompatible packages, for example. the solver said "girl, no." π30β Error in package definition, or other metadata files. and ngl, using--strictmakes it raise this error way 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. π40β Sync error. couldn't fetch some remotes from the network. this can be a partial error too. network said no. π‘50β Configuration error. opam or the system config doesn't allow the operation, and it needs fixing. go fix it bestie. π§60β Solver failure. the solver failed to return a sound answer. it can be because of a broken external solver, or an error in solver configuration. π§ π₯99β Internal error. something went wrong, most likely due to a bug in opam itself. not me, not you, it's opam. π130β User interrupt.SIGINTwas received, generally because the user pressed Ctrl+C. you did that. you did that. π
and then there's this lil extra set, the generic convention vibes:
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 docs go deeper, bestie. See <a href="https://opam.ocaml.org/doc">https://opam.ocaml.org/doc</a>.
wait no, no links β see https://opam.ocaml.org/doc. that's the plug. π«Ά
π AUTHORS π
these are the legends, the icons, the people who built the thing you're using rn. 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>
π SEE ALSO π
that's it. that's the family. π¦
π BUGS π
found something cursed? check bug reports at https://github.com/ocaml/opam/issues. π
and that's a wrap on OPAM-REMOTE(1) from Opam 2.6.1 β thank u for coming to my ted talk, go touch some packages and stay hydrated bestie β¨ππ«Ά
π¦ 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