1OPAM ADMIN(1) Opam admin Manual OPAM ADMIN(1)
2
3
4
6 opam admin - Tools for repository administrators
7
9 opam admin COMMAND ...
10
12 This command can perform various actions on repositories in the opam
13 format. It is expected to be run from the root of a repository, i.e. a
14 directory containing a 'repo' file and a subdirectory 'packages/'
15 holding package definition within subdirectories. A 'compilers/'
16 subdirectory (opam repository format version < 2) will also be used by
17 the upgrade-format subcommand.
18
20 add-constraint
21 Adds version constraints on all dependencies towards a given
22 package
23
24 add-hashes
25 Add archive hashes to an opam repository.
26
27 cache
28 Fills a local cache of package archives
29
30 check
31 Runs some consistency checks on a repository
32
33 filter
34 Filters a repository to only keep selected packages
35
36 help
37 Display help about opam admin and opam admin subcommands.
38
39 index
40 Generate an inclusive index file for serving over HTTP.
41
42 lint
43 Runs 'opam lint' and reports on a whole repository
44
45 list
46 Lists packages from a repository
47
48 upgrade
49 Upgrades repository from earlier opam versions.
50
52 make
53 An alias for index.
54
56 These options are common to all commands.
57
58 --best-effort
59 Don't fail if all requested packages can't be installed: try to
60 install as many as possible. Note that not all external solvers may
61 support this option (recent versions of aspcud or mccs should).
62 This is equivalent to setting $OPAMBESTEFFORT environment variable.
63
64 --color=WHEN
65 Colorize the output. WHEN must be one of `always', `never' or
66 `auto'.
67
68 --criteria=CRITERIA
69 Specify user preferences for dependency solving for this run.
70 Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
71 on the supported language, and the external solvers available, see
72 http://opam.ocaml.org/doc/External_solvers.html. A general guide to
73 using solver preferences can be found at
74 http://www.dicosmo.org/Articles/usercriteria.pdf.
75
76 --cudf=FILENAME
77 Debug option: Save the CUDF requests sent to the solver to
78 FILENAME-<n>.cudf.
79
80 --debug
81 Print debug message to stderr. This is equivalent to setting
82 $OPAMDEBUG to "true".
83
84 --debug-level=LEVEL
85 Like --debug, but allows specifying the debug level (--debug sets
86 it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
87
88 --git-version
89 Print the git version of opam, if set (i.e. you are using a
90 development version), and exit.
91
92 --help[=FMT] (default=auto)
93 Show this help in format FMT. The value FMT must be one of `auto',
94 `pager', `groff' or `plain'. With `auto', the format is `pager` or
95 `plain' whenever the TERM env var is `dumb' or undefined.
96
97 --ignore-pin-depends
98 Ignore extra pins required by packages that get pinned, either
99 manually through opam pin or through opam install DIR. This is
100 equivalent to setting IGNOREPINDEPENDS=true.
101
102 --json=FILENAME
103 Save the results of the opam run in a computer-readable file. If
104 the filename contains the character `%', it will be replaced by an
105 index that doesn't overwrite an existing file. Similar to setting
106 the $OPAMJSON variable.
107
108 --no-aspcud
109 Deprecated.
110
111 --no-auto-upgrade
112 When configuring or updating a repository that is written for an
113 earlier opam version (1.2), opam internally converts it to the
114 current format. This disables this behaviour. Note that
115 repositories should define their format version in a 'repo' file at
116 their root, or they will be assumed to be in the older format. It
117 is, in any case, preferable to upgrade the repositories manually
118 using opam admin upgrade [--mirror URL] when possible.
119
120 -q, --quiet
121 Disables --verbose.
122
123 --root=ROOT
124 Use ROOT as the current root path. This is equivalent to setting
125 $OPAMROOT to ROOT.
126
127 --safe, --readonly
128 Make sure nothing will be automatically updated or rewritten.
129 Useful for calling from completion scripts, for example. Will fail
130 whenever such an operation is needed ; also avoids waiting for
131 locks, skips interactive questions and overrides the $OPAMDEBUG
132 variable. This is equivalent to set environment variable $OPAMSAFE.
133
134 --solver=CMD
135 Specify the CUDF solver to use for resolving package installation
136 problems. This is either a predefined solver (this version of opam
137 supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
138 aspcud-old, packup), or a custom command that should contain the
139 variables %{input}%, %{output}%, %{criteria}%, and optionally
140 %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
141
142 --strict
143 Fail whenever an error is found in a package definition or a
144 configuration file. The default is to continue silently if
145 possible.
146
147 --switch=SWITCH
148 Use SWITCH as the current compiler switch. This is equivalent to
149 setting $OPAMSWITCH to SWITCH.
150
151 --use-internal-solver
152 Disable any external solver, and use the built-in one (this
153 requires that opam has been compiled with a built-in solver). This
154 is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
155
156 -v, --verbose
157 Be more verbose. One -v shows all package commands, repeat to also
158 display commands called internally (e.g. tar, curl, patch etc.)
159 Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
160
161 --version
162 Show version information.
163
164 -w, --working-dir
165 Whenever updating packages that are bound to a local,
166 version-controlled directory, update to the current working state
167 of their source instead of the last committed state, or the ref
168 they are pointing to. This only affects packages explicitly listed
169 on the command-line.It can also be set with $OPAMWORKINGDIR.
170
171 -y, --yes
172 Answer yes to all yes/no questions without prompting. This is
173 equivalent to setting $OPAMYES to "true".
174
176 Opam makes use of the environment variables listed here. Boolean
177 variables should be set to "0", "no", "false" or the empty string to
178 disable, "1", "yes" or "true" to enable.
179
180 OPAMALLPARENS surround all filters with parenthesis
181
182 OPAMAUTOREMOVE see remove option `--auto-remove`
183
184 OPAMBESTEFFORT see option `--best-effort`
185
186 OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
187 the criteria when the `--best-effort` option is set, and is expected to
188 maximise the `opam-query` property in the solution
189
190 OPAMCOLOR, when set to always or never, sets a default value for the
191 --color option.
192
193 OPAMCRITERIA specifies user preferences for dependency solving. The
194 default value depends on the solver version, use `config report` to
195 know the current setting. See also option --criteria
196
197 OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
198
199 OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
200 for more options.
201
202 OPAMDEBUG see options `--debug' and `--debug-level'.
203
204 OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
205
206 OPAMDRYRUN see option `--dry-run`
207
208 OPAMEDITOR sets the editor to use for opam file editing, overrides
209 $EDITOR and $VISUAL
210
211 OPAMERRLOGLEN sets the number of log lines printed when a sub-process
212 fails. 0 to print all.
213
214 OPAMEXTERNALSOLVER see option `--solver'.
215
216 OPAMFAKE see option `--fake`
217
218 OPAMFETCH specifies how to download files: either `wget', `curl' or a
219 custom command where variables %{url}%, %{out}%, %{retry}%,
220 %{compress}% and %{checksum}% will be replaced. Overrides the
221 'download-command' value from the main config file.
222
223 OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
224
225 OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
226
227 OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
228
229 OPAMJOBS sets the maximum number of parallel workers to run.
230
231 OPAMJSON log json output to the given file (use character `%' to index
232 the files)
233
234 OPAMLOCKED see install option `--locked`
235
236 OPAMLOGS logdir sets log directory, default is a temporary directory in
237 /tmp
238
239 OPAMMAKECMD set the system make command to use
240
241 OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
242 in an earlier format to the current one, on 'update' or 'init'.
243
244 OPAMKEEPLOGS tells opam to not remove some temporary command logs and
245 some backups. This skips some finalisers and may also help to get more
246 reliable backtraces
247
248 OPAMLOCKRETRIES sets the number of tries after which opam gives up
249 acquiring its lock and fails. <= 0 means infinite wait.
250
251 OPAMMERGEOUT merge process outputs, stderr on stdout
252
253 OPAMNO answer no to any question asked.
254
255 OPAMNOASPCUD Deprecated.
256
257 OPAMNOCHECKSUMS enables option --no-checksums when available.
258
259 OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
260
261 OPAMPINKINDAUTO sets whether version control systems should be detected
262 when pinning to a local path. Enabled by default since 1.3.0.
263
264 OPAMPRECISETRACKING fine grain tracking of directories
265
266 OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
267 available (e.g. for `opam install`).
268
269 OPAMRETRES sets the number of tries before failing downloads.
270
271 OPAMROOT see option `--root'. This is automatically set by `opam env
272 --root=DIR --set-root'.
273
274 OPAMROOTISOK don't complain when running as root.
275
276 OPAMSAFE see option `--safe'
277
278 OPAMSHOW see option `--show`
279
280 OPAMSKIPUPDATE see option `--skip-updates`
281
282 OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
283 compatibility testing only.
284
285 OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
286 60.0, set to 0 for unlimited. Note that all solvers may not support
287 this option.
288
289 OPAMSTATUSLINE display a dynamic status line showing what's currently
290 going on on the terminal. (one of one of `always', `never' or `auto')
291
292 OPAMSTATS display stats at the end of command
293
294 OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
295
296 OPAMSWITCH see option `--switch'. Automatically set by `opam env
297 --switch=SWITCH --set-switch'.
298
299 OPAMUNLOCKBASE see install option `--unlock-base`
300
301 OPAMUPGRADECRITERIA specifies user preferences for dependency solving
302 when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
303 are set. See also option --criteria
304
305 OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
306
307 OPAMUSEOPENSSL force openssl use for hash computing
308
309 OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
310 or `auto'). By default `auto', which is determined from the locale).
311
312 OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
313 Implies OPAMUTF8. This is set by default on OSX only.
314
315 OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
316 an opam repository update
317
318 OPAMVAR_var overrides the contents of the variable var when
319 substituting `%{var}%` strings in `opam` files.
320
321 OPAMVAR_package_var overrides the contents of the variable package:var
322 when substituting `%{package:var}%` strings in `opam` files.
323
324 OPAMVERBOSE see option `--verbose'.
325
326 OPAMWORKINGDIR see option `--working-dir`
327
328 OPAMYES see option `--yes'.
329
331 As an exception to the following, the `exec' command returns 127 if the
332 command was not found or couldn't be executed, and the command's exit
333 value otherwise.
334
335 0 Success, or true for boolean queries.
336
337 1 False. Returned when a boolean return value is expected, e.g. when
338 running with --check, or for queries like opam lint.
339
340 2 Bad command-line arguments, or command-line arguments pointing to
341 an invalid context (e.g. file not following the expected format).
342
343 5 Not found. You requested something (package, version, repository,
344 etc.) that couldn't be found.
345
346 10 Aborted. The operation required confirmation, which wasn't given.
347
348 15 Could not acquire the locks required for the operation.
349
350 20 There is no solution to the user request. This can be caused by
351 asking to install two incompatible packages, for example.
352
353 30 Error in package definition, or other metadata files. Using
354 --strict raises this error more often.
355
356 31 Package script error. Some package operations were unsuccessful.
357 This may be an error in the packages or an incompatibility with
358 your system. This can be a partial error.
359
360 40 Sync error. Could not fetch some remotes from the network. This can
361 be a partial error.
362
363 50 Configuration error. Opam or system configuration doesn't allow
364 operation, and needs fixing.
365
366 60 Solver failure. The solver failed to return a sound answer. It can
367 be due to a broken external solver, or an error in solver
368 configuration.
369
370 99 Internal error. Something went wrong, likely due to a bug in opam
371 itself.
372
373 130 User interrupt. SIGINT was received, generally due to the user
374 pressing Ctrl-C.
375
377 See https://opam.ocaml.org/doc.
378
380 Vincent Bernardoff <vb@luminar.eu.org>
381 Raja Boujbel <raja.boujbel@ocamlpro.com>
382 Roberto Di Cosmo <roberto@dicosmo.org>
383 Thomas Gazagnaire <thomas@gazagnaire.org>
384 Louis Gesbert <louis.gesbert@ocamlpro.com>
385 Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
386 Anil Madhavapeddy <anil@recoil.org>
387 Guillem Rieu <guillem.rieu@ocamlpro.com>
388 Ralf Treinen <ralf.treinen@pps.jussieu.fr>
389 Frederic Tuong <tuong@users.gforge.inria.fr>
390
392 Check bug reports at https://github.com/ocaml/opam/issues.
393
394
395
396Opam admin 2.0.6 OPAM ADMIN(1)