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. KIND has to be one of http, local, git, darcs or hg. 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 means 1 is the highest priority πŸ‘‘. negative ints can be used to select from the lowest priority, with -1 being last. (set-repos can 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 of aspcud or mccs should). this is equivalent to setting the $OPAMBESTEFFORT environment variable 🌸
  • --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. heads up: 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 πŸ¦‹
  • --color=WHEN β€” colorize the output. WHEN must be one of always, never or auto 🌈
  • --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 ⭐
  • --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 πŸ”₯
  • --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 πŸ›
  • --debug β€” print debug message to stderr. this is equivalent to setting $OPAMDEBUG to "true" πŸ’€
  • --debug-level=LEVEL β€” like --debug, but allows specifying the debug level (--debug sets it to 1). equivalent to setting $OPAMDEBUG to 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 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 🫢
  • --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 πŸŽ€
  • --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 ✨
  • --no β€” answer no to all opam yes/no questions without prompting. see also --confirm-level. this is equivalent to setting $OPAMNO to "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 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 🌸
  • --no-self-upgrade β€” opam will replace itself with a newer binary found at OPAMROOT/opam if present. this disables this behaviour πŸ›‘
  • -q, --quiet β€” disables --verbose 🀫
  • --root=ROOT β€” use ROOT as the current root path. this is equivalent to setting $OPAMROOT to ROOT 🌳
  • --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 πŸ›‘οΈ
  • --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 🧠
  • --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 β€” use SWITCH as the current compiler switch. this is equivalent to setting $OPAMSWITCH to 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 $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER πŸ’œ
  • -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" πŸ“’
  • --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 $OPAMYES to "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-effort option is set, and it's expected to maximise the opam-query property in the solution ✨
  • OPAMBUILDDOC β€” πŸ’€ Removed in 2.1.
  • OPAMBUILDTEST β€” πŸ’€ Removed in 2.1.
  • OPAMCLI β€” see the option --cli.
  • OPAMCOLOR β€” when set to always or never, it sets a default value for the --color option 🎨
  • OPAMCONFIRMLEVEL β€” see the option --confirm-level. Heads up: OPAMCONFIRMLEVEL has priority over OPAMYES and OPAMNO πŸ‘‘
  • OPAMCRITERIA β€” specifies user preferences for dependency solving. The default value depends on the solver version, so use config report to find out the current setting. See also the option --criteria.
  • OPAMCUDFFILE β€” saves 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 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-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. It overrides $EDITOR and $VISUAL πŸ’…
  • OPAMERRLOGLEN β€” sets the number of log lines printed when a sub-process fails. 0 prints all of them.
  • 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. This 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 πŸƒβ€β™€οΈ
  • 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, the default is a temporary directory in /tmp
  • OPAMMAKECMD β€” set the system make command to use.
  • OPAMMERGEOUT β€” merge process outputs, with stderr on stdout.
  • OPAMNO β€” answers no to any question asked, see the options --no and --confirm-level. OPAMNO is ignored if either OPAMCONFIRMLEVEL or OPAMYES is set πŸ™…β€β™€οΈ
  • OPAMNOAGGREGATE β€” with opam admin check, don't aggregate packages.
  • OPAMNOASPCUD β€” Deprecated.
  • OPAMNOAUTOUPGRADE β€” disables the 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.
  • 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 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-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 ⚠️
  • 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 it 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.
  • 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.).
  • 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. It 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.
  • OPAMUTF8 β€” use UTF8 characters in output (one of always, never or auto). By default it's auto, which is determined from the locale 🌍
  • OPAMUTF8MSGS β€” use extended UTF8 characters (camels πŸͺ) in opam messages. It implies OPAMUTF8. 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-on
  • OPAMVERSIONLAGPOWER β€” 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 --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 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:

exec does not follow the codes below. nope. the exec command returns 127 if 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! or true for 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 like opam 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 --strict makes 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. SIGINT was 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