1OPAM ADMIN-FILTER(1)           Opam admin Manual          OPAM ADMIN-FILTER(1)
2
3
4

NAME

6       opam admin-filter - Filters a repository to only keep selected packages
7

SYNOPSIS

9       opam admin filter [OPTION]… [PATTERNS]…
10

DESCRIPTION

12       This command removes all package definitions that don't match the
13       search criteria (specified similarly to 'opam admin list') from a
14       repository.
15

ARGUMENTS

17       PATTERNS
18           Package patterns with globs. matching against NAME or NAME.VERSION
19

OPTIONS

21       --dry-run
22           List the removal commands, without actually performing them
23
24       --environment=VAR=VALUE[;VAR=VALUE]
25           Use the given opam environment, in the form of a list of
26           comma-separated 'var=value' bindings, when resolving variables.
27           This is used e.g. when computing available packages: if undefined,
28           availability of packages will be assumed as soon as it can not be
29           resolved purely from globally defined variables. Note that, unless
30           overridden, variables like 'root' or 'opam-version' may be taken
31           from the current opam installation. What is defined in
32           ~/.opam/config is always ignored.
33
34       --no
35           Answer no to all opam yes/no questions without prompting. See also
36           --confirm-level. This is equivalent to setting $OPAMNO to "true".
37
38       --remove
39           Invert the behaviour and remove the matching packages, keeping the
40           ones that don't match.
41
42       -y, --yes
43           Answer yes to all opam yes/no questions without prompting. See also
44           --confirm-level. This is equivalent to setting $OPAMYES to "true".
45

PACKAGE SELECTION OPTIONS

47       -a, --available
48           List only packages that are available according to the defined
49           environment. Without --environment, this will include any packages
50           for which availability is not resolvable at this point.
51
52       -A, --all
53           Include all, even uninstalled or unavailable packages
54
55       --coinstallable-with=PACKAGES
56           Only list packages that are compatible with all of PACKAGES.
57
58       --conflicts-with=PACKAGES
59           List packages that have declared conflicts with at least one of the
60           given list. This includes conflicts defined from the packages in
61           the list, from the other package, or by a common conflict-class:
62           field.
63
64       --depends-on=PACKAGES
65           List only packages that depend on one of (comma-separated)
66           PACKAGES.
67
68       --depopts
69           Include optional dependencies in dependency requests.
70
71       --dev
72           Include development packages in dependencies.
73
74       --field-match=FIELD:PATTERN
75           Filter packages with a match for PATTERN on the given FIELD
76
77       --has-flag=FLAG
78           Only include packages which have the given flag set. Package flags
79           are one of: light-uninstall verbose plugin compiler conf
80
81       --has-tag=TAG
82           Only includes packages which have the given tag set
83
84       --installable
85           List only packages that are installable according to the defined
86           environment (this calls the solver and may be more costly; a
87           package depending on an unavailable one may be available, but is
88           never installable)
89
90       --nobuild
91           Exclude build dependencies (they are included by default).
92
93       --or
94           Instead of selecting packages that match all the criteria, select
95           packages that match any of them
96
97       --post
98           Include dependencies tagged as post.
99
100       --recursive
101           With `--depends-on' and `--required-by', display all transitive
102           dependencies rather than just direct dependencies.
103
104       --required-by=PACKAGES
105           List only the dependencies of (comma-separated) PACKAGES.
106
107       --resolve=PACKAGES
108           Restrict to a solution to install (comma-separated) PACKAGES, i.e.
109           a consistent set of packages including those. This is subtly
110           different from `--required-by --recursive`, which is more
111           predictable and can't fail, but lists all dependencies
112           independently without ensuring consistency. Without `--installed`,
113           the answer is self-contained and independent of the current
114           installation. With `--installed', it's computed from the set of
115           currently installed packages. `--no-switch` further makes the
116           solution independent from the currently pinned packages,
117           architecture, and compiler version. The combination with
118           `--depopts' is not supported.
119
120       -t, --with-test, --test
121           Include test-only dependencies.
122
123       --with-doc, --doc
124           Include doc-only dependencies.
125

COMMON OPTIONS

127       These options are common to all commands.
128
129       --best-effort
130           Don't fail if all requested packages can't be installed: try to
131           install as many as possible. Note that not all external solvers may
132           support this option (recent versions of aspcud or mccs should).
133           This is equivalent to setting $OPAMBESTEFFORT environment variable.
134
135       --cli=MAJOR.MINOR (absent=2.1)
136           Use the command-line interface syntax and semantics of MAJOR.MINOR.
137           Intended for any persistent use of opam (scripts, blog posts,
138           etc.), any version of opam in the same MAJOR series will behave as
139           for the specified MINOR release. The flag was not available in opam
140           2.0, so to select the 2.0 CLI, set the OPAMCLI environment variable
141           to 2.0 instead of using this parameter.
142
143       --color=WHEN
144           Colorize the output. WHEN must be one of always, never or auto.
145
146       --confirm-level=LEVEL
147           Confirmation level, LEVEL must be one of ask, no, yes or
148           unsafe-yes. Can be specified more than once. If --yes or --no are
149           also given, the value of the last --confirm-level is taken into
150           account. This is equivalent to setting  $OPAMCONFIRMLEVEL`.
151
152       --criteria=CRITERIA
153           Specify user preferences for dependency solving for this run.
154           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
155           on the supported language, and the external solvers available, see
156           http://opam.ocaml.org/doc/External_solvers.html. A general guide to
157           using solver preferences can be found at
158           http://www.dicosmo.org/Articles/usercriteria.pdf.
159
160       --cudf=FILENAME
161           Debug option: Save the CUDF requests sent to the solver to
162           FILENAME-<n>.cudf.
163
164       --debug
165           Print debug message to stderr. This is equivalent to setting
166           $OPAMDEBUG to "true".
167
168       --debug-level=LEVEL
169           Like --debug, but allows specifying the debug level (--debug sets
170           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
171
172       --git-version
173           Print the git version of opam, if set (i.e. you are using a
174           development version), and exit.
175
176       --help[=FMT] (default=auto)
177           Show this help in format FMT. The value FMT must be one of auto,
178           pager, groff or plain. With auto, the format is pager or plain
179           whenever the TERM env var is dumb or undefined.
180
181       --ignore-pin-depends
182           Ignore extra pins required by packages that get pinned, either
183           manually through opam pin or through opam install DIR. This is
184           equivalent to setting IGNOREPINDEPENDS=true.
185
186       --json=FILENAME
187           Save the results of the opam run in a computer-readable file. If
188           the filename contains the character `%', it will be replaced by an
189           index that doesn't overwrite an existing file. Similar to setting
190           the $OPAMJSON variable.
191
192       --no-aspcud
193           Removed in 2.1.
194
195       --no-auto-upgrade
196           When configuring or updating a repository that is written for an
197           earlier opam version (1.2), opam internally converts it to the
198           current format. This disables this behaviour. Note that
199           repositories should define their format version in a 'repo' file at
200           their root, or they will be assumed to be in the older format. It
201           is, in any case, preferable to upgrade the repositories manually
202           using opam admin upgrade [--mirror URL] when possible.
203
204       -q, --quiet
205           Disables --verbose.
206
207       --root=ROOT
208           Use ROOT as the current root path. This is equivalent to setting
209           $OPAMROOT to ROOT.
210
211       --safe, --readonly
212           Make sure nothing will be automatically updated or rewritten.
213           Useful for calling from completion scripts, for example. Will fail
214           whenever such an operation is needed ; also avoids waiting for
215           locks, skips interactive questions and overrides the $OPAMDEBUG
216           variable. This is equivalent to set environment variable $OPAMSAFE.
217
218       --solver=CMD
219           Specify the CUDF solver to use for resolving package installation
220           problems. This is either a predefined solver (this version of opam
221           supports builtin-mccs+lp(), builtin-mccs+glpk,
222           builtin-dummy-z3-solver, builtin-dummy-0install-solver, aspcud,
223           mccs, aspcud-old, packup), or a custom command that should contain
224           the variables %{input}%, %{output}%, %{criteria}%, and optionally
225           %{timeout}%. This is equivalent to setting $OPAMEXTERNALSOLVER.
226
227       --strict
228           Fail whenever an error is found in a package definition or a
229           configuration file. The default is to continue silently if
230           possible.
231
232       --switch=SWITCH
233           Use SWITCH as the current compiler switch. This is equivalent to
234           setting $OPAMSWITCH to SWITCH.
235
236       --use-internal-solver
237           Disable any external solver, and use the built-in one (this
238           requires that opam has been compiled with a built-in solver). This
239           is equivalent to setting $OPAMNOASPCUD or $OPAMUSEINTERNALSOLVER.
240
241       -v, --verbose
242           Be more verbose. One -v shows all package commands, repeat to also
243           display commands called internally (e.g. tar, curl, patch etc.)
244           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
245
246       --version
247           Show version information.
248
249       -w, --working-dir
250           Whenever updating packages that are bound to a local,
251           version-controlled directory, update to the current working state
252           of their source instead of the last committed state, or the ref
253           they are pointing to. As source directory is copied as it is, if it
254           isn't clean it may result on a opam build failure.This only affects
255           packages explicitly listed on the command-line.It can also be set
256           with $OPAMWORKINGDIR.
257

ENVIRONMENT

259       Opam makes use of the environment variables listed here. Boolean
260       variables should be set to "0", "no", "false" or the empty string to
261       disable, "1", "yes" or "true" to enable.
262
263       OPAMALLPARENS surround all filters with parenthesis.
264
265       OPAMASSUMEDEPEXTS see option `--assume-depexts'.
266
267       OPAMAUTOREMOVE see remove option `--auto-remove'.
268
269       OPAMBESTEFFORT see option `--best-effort'.
270
271       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
272       the criteria when the `--best-effort' option is set, and is expected to
273       maximise the `opam-query' property in the solution.
274
275       OPAMBUILDDOC Removed in 2.1.
276
277       OPAMBUILDTEST Removed in 2.1.
278
279       OPAMCLI see option `--cli'.
280
281       OPAMCOLOR when set to always or never, sets a default value for the
282       `--color' option.
283
284       OPAMCONFIRMLEVEL see option `--confirm-level`. OPAMCONFIRMLEVEL has
285       priority over OPAMYES and OPAMNO.
286
287       OPAMCRITERIA specifies user preferences for dependency solving. The
288       default value depends on the solver version, use `config report' to
289       know the current setting. See also option --criteria.
290
291       OPAMCUDFFILE save the cudf graph to file-actions-explicit.dot.
292
293       OPAMCUDFTRIM controls the filtering of unrelated packages during CUDF
294       preprocessing.
295
296       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
297       for more options.
298
299       OPAMDEBUG see options `--debug' and `--debug-level'.
300
301       OPAMDEBUGSECTIONS if set, limits debug messages to the space-separated
302       list of sections. Sections can optionally have a specific debug level
303       (for example, CLIENT:2 or CLIENT CUDF:2), but otherwise use
304       `--debug-level'.
305
306       OPAMDIGDEPTH defines how aggressive the lookup for conflicts during
307       CUDF preprocessing is.
308
309       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
310
311       OPAMDROPWORKINGDIR overrides packages previously updated with
312       --working-dir on update. Without this variable set, opam would keep
313       them unchanged unless explicitly named on the command-line.
314
315       OPAMDRYRUN see option `--dry-run'.
316
317       OPAMEDITOR sets the editor to use for opam file editing, overrides
318       $EDITOR and $VISUAL.
319
320       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
321       fails. 0 to print all.
322
323       OPAMEXTERNALSOLVER see option `--solver'.
324
325       OPAMFAKE see option `--fake'.
326
327       OPAMFETCH specifies how to download files: either `wget', `curl' or a
328       custom command where variables %{url}%, %{out}%, %{retry}%,
329       %{compress}% and %{checksum}% will be replaced. Overrides the
330       'download-command' value from the main config file.
331
332       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup.
333
334       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on'.
335
336       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends'.
337
338       OPAMINPLACEBUILD see option `--inplace-build'.
339
340       OPAMJOBS sets the maximum number of parallel workers to run.
341
342       OPAMJSON log json output to the given file (use character `%' to index
343       the files).
344
345       OPAMKEEPBUILDDIR see install option `--keep-build-dir'.
346
347       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
348       some backups. This skips some finalisers and may also help to get more
349       reliable backtraces.
350
351       OPAMLOCKED combination of `--locked' and `--lock-suffix' options.
352
353       OPAMLOGS logdir sets log directory, default is a temporary directory in
354       /tmp
355
356       OPAMMAKECMD set the system make command to use.
357
358       OPAMMERGEOUT merge process outputs, stderr on stdout.
359
360       OPAMNO answer no to any question asked, see options `--no` and
361       `--confirm-level`. OPAMNO is ignored if either OPAMCONFIRMLEVEL or
362       OPAMYES is set.
363
364       OPAMNOAGGREGATE with `opam admin check', don't aggregate packages.
365
366       OPAMNOASPCUD Deprecated.
367
368       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
369       in an earlier format to the current one, on 'update' or 'init'.
370
371       OPAMNOCHECKSUMS enables option --no-checksums when available.
372
373       OPAMNODEPEXTS disables system dependencies handling, see option
374       `--no-depexts'.
375
376       OPAMNOENVNOTICE Internal.
377
378       OPAMNOSELFUPGRADE see option `--no-self-upgrade'
379
380       OPAMPINKINDAUTO sets whether version control systems should be detected
381       when pinning to a local path. Enabled by default since 1.3.0.
382
383       OPAMPRECISETRACKING fine grain tracking of directories.
384
385       OPAMPREPRO set this to false to disable CUDF preprocessing. Less
386       efficient, but might help debugging solver issue.
387
388       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
389       available (e.g. for `opam install').
390
391       OPAMRETRIES sets the number of tries before failing downloads.
392
393       OPAMREUSEBUILDDIR see option `--reuse-build-dir'.
394
395       OPAMROOT see option `--root'. This is automatically set by `opam env
396       --root=DIR --set-root'.
397
398       OPAMROOTISOK don't complain when running as root.
399
400       OPAMSAFE see option `--safe'.
401
402       OPAMSHOW see option `--show'.
403
404       OPAMSKIPUPDATE see option `--skip-updates'.
405
406       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
407       compatibility testing only.
408
409       OPAMSOLVERALLOWSUBOPTIMAL (default `true') allows some solvers to still
410       return a solution when they reach timeout; while the solution remains
411       assured to be consistent, there is no guarantee in this case that it
412       fits the expected optimisation criteria. If `true', opam willcontinue
413       with a warning, if `false' a timeout is an error. Currently only the
414       builtin-z3 backend handles this degraded case.
415
416       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
417       60.0, set to 0 for unlimited. Note that all solvers may not support
418       this option.
419
420       OPAMSTATS display stats at the end of command.
421
422       OPAMSTATUSLINE display a dynamic status line showing what's currently
423       going on on the terminal. (one of one of always, never or auto)
424
425       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.).
426
427       OPAMSWITCH see option `--switch'. Automatically set by `opam env
428       --switch=SWITCH --set-switch'.
429
430       OPAMUNLOCKBASE see install option `--unlock-base'.
431
432       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
433       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
434       are set. See also option --criteria.
435
436       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
437
438       OPAMUSEOPENSSL force openssl use for hash computing.
439
440       OPAMUTF8 use UTF8 characters in output (one of one of always, never or
441       auto). By default `auto', which is determined from the locale).
442
443       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
444       Implies OPAMUTF8. This is set by default on OSX only.
445
446       OPAMVALIDATIONHOOK if set, uses the `%{hook%}' command to validate an
447       opam repository update.
448
449       OPAMVERBOSE see option `--verbose'.
450
451       OPAMVERSIONLAGPOWER do not use.
452
453       OPAMWITHDOC see install option `--with-doc'.
454
455       OPAMWITHTEST see install option `--with-test.
456
457       OPAMWORKINGDIR see option `--working-dir'.
458
459       OPAMYES see options `--yes' and `--confirm-level`. OPAMYES has has
460       priority over OPAMNO and is ignored if OPAMCONFIRMLEVEL is set.
461
462       OPAMVAR_var overrides the contents of the variable var when
463       substituting `%{var}%` strings in `opam` files.
464
465       OPAMVAR_package_var overrides the contents of the variable package:var
466       when substituting `%{package:var}%` strings in `opam` files.
467

CLI VERSION

469       All scripts and programmatic invocations of opam should use `--cli' in
470       order to ensure that they work seamlessly with future versions of the
471       opam client. Additionally, blog posts or other documentation can
472       benefit, as it prevents information from becoming stale.
473
474       Although opam only supports roots (~/.opam/) for the current version,
475       it does provide backwards compatibility for its command-line interface.
476
477       Since CLI version support was only added in opam 2.1, use OPAMCLI to
478       select 2.0 support (as opam 2.0 will just ignore it), and `--cli=2.1'
479       for 2.1 (or later) versions, since an environment variable controlling
480       the parsing of syntax is brittle. To this end, opam displays a warning
481       if OPAMCLI specifies a valid version other than 2.0, and also if
482       `--cli=2.0' is specified.
483
484       The command-line version is selected by using the `--cli' option or the
485       OPAMCLI environment variable. `--cli' may be specified morethan once,
486       where the last instance takes precedence. OPAMCLI is only inspected if
487       `--cli' is not given.
488

EXIT STATUS

490       As an exception to the following, the `exec' command returns 127 if the
491       command was not found or couldn't be executed, and the command's exit
492       value otherwise.
493
494       0   Success, or true for boolean queries.
495
496       1   False. Returned when a boolean return value is expected, e.g. when
497           running with --check, or for queries like opam lint.
498
499       2   Bad command-line arguments, or command-line arguments pointing to
500           an invalid context (e.g. file not following the expected format).
501
502       5   Not found. You requested something (package, version, repository,
503           etc.) that couldn't be found.
504
505       10  Aborted. The operation required confirmation, which wasn't given.
506
507       15  Could not acquire the locks required for the operation.
508
509       20  There is no solution to the user request. This can be caused by
510           asking to install two incompatible packages, for example.
511
512       30  Error in package definition, or other metadata files. Using
513           --strict raises this error more often.
514
515       31  Package script error. Some package operations were unsuccessful.
516           This may be an error in the packages or an incompatibility with
517           your system. This can be a partial error.
518
519       40  Sync error. Could not fetch some remotes from the network. This can
520           be a partial error.
521
522       50  Configuration error. Opam or system configuration doesn't allow
523           operation, and needs fixing.
524
525       60  Solver failure. The solver failed to return a sound answer. It can
526           be due to a broken external solver, or an error in solver
527           configuration.
528
529       99  Internal error. Something went wrong, likely due to a bug in opam
530           itself.
531
532       130 User interrupt. SIGINT was received, generally due to the user
533           pressing Ctrl-C.
534

FURTHER DOCUMENTATION

536       See https://opam.ocaml.org/doc.
537

AUTHORS

539       Vincent Bernardoff <vb@luminar.eu.org>
540       Raja Boujbel <raja.boujbel@ocamlpro.com>
541       Roberto Di Cosmo <roberto@dicosmo.org>
542       Thomas Gazagnaire <thomas@gazagnaire.org>
543       Louis Gesbert <louis.gesbert@ocamlpro.com>
544       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
545       Anil Madhavapeddy <anil@recoil.org>
546       Guillem Rieu <guillem.rieu@ocamlpro.com>
547       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
548       Frederic Tuong <tuong@users.gforge.inria.fr>
549

BUGS

551       Check bug reports at https://github.com/ocaml/opam/issues.
552
553
554
555Opam admin 2.1.3                                          OPAM ADMIN-FILTER(1)
Impressum