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