Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
OPAM-SWITCH(1)			  Opam Manual			OPAM-SWITCH(1)

       opam-switch - Manage multiple installation of compilers.

       opam switch [OPTION]... [COMMAND] [ARG]...

       This command allows one to switch between different compiler versions,
       installing the compiler if opam switch is used to switch	to that
       compiler	for the	first time. The	different compiler versions are
       totally independent from	each other, meaning that OPAM maintains	a
       separate	state (e.g. list of installed packages...) for each.

       See the documentation of	opam switch list to see	the compilers which
       are available, and how to switch	or to install a	new one.

       Without argument, defaults to list.

	   With	a SWITCH argument, defaults to set SWITCH.

       install SWITCH
	   Install the given compiler. The command fails if the	switch is
	   already installed (e.g. it will not transparently switch to the
	   installed compiler switch, as with set).

       set SWITCH
	   Set the currently active switch, installing it if needed.

       remove SWITCH
	   Remove the given compiler.

       export FILE
	   Save	the current switch state to a file.

       import FILE
	   Import a saved switch state.

       reinstall SWITCH
	   Reinstall the given compiler	switch.	This will also reinstall all

	   List	compilers. By default, lists installed and `standard'
	   compilers. Use `--all' to get the list of all installable
	   compilers. The first	column displays	the switch name	(if any), the
	   second one the switch state (C = current, I = installed, -- = not
	   installed), the third one the compiler name and the last one	the
	   compiler description. To switch to an already installed compiler
	   alias (with state = I), use opam switch <name>. If you want to use
	   a new compiler <comp>, use opam switch <comp>: this will download,
	   compile and create a	fresh and independent environment where	new
	   packages can	be installed. If you want to create a new compiler
	   alias (for instance because you already have	this compiler version
	   installed), use opam	switch <name> --alias-of <comp>. In case
	   <name> and <comp> are the same, this	is equivalent to opam switch

	   Show	the current compiler.

       -A COMP,	--alias-of=COMP
	   The name of the compiler description	which will be aliased.

       -a, --all
	   List	all the	compilers which	can be installed on the	system.

       -b, --keep-build-dir
	   Keep	the build directory. This is equivalent	to setting
	   $OPAMKEEPBUILDDIR to	"true".

       -d, --build-doc
	   Build the package documentation. This is equivalent to setting
	   $OPAMBUILDDOC to "true".

	   Simulate the	command, but don't actually perform any	changes.

       -e TAGS,	--external=TAGS
	   Display the external	packages associated to the given tags. This is
	   deprecated, use `opam list --external' instead

	   This	option registers the actions into the OPAM database, without
	   actually performing them. WARNING: This option is dangerous and
	   likely to break your	OPAM environment. You probably want
	   `--dry-run'.	You've been warned.

       -i, --installed
	   List	installed compiler switches only.

       -j JOBS,	--jobs=JOBS
	   Set the maximal number of concurrent	jobs to	use. You can also set
	   it using the	$OPAMJOBS environment variable.

	   Save	the result output of an	OPAM run in a computer-readable	file

       -m MAKE,	--make=MAKE
	   Use MAKE as the default 'make' command.

	   Do not verify the checksum of downloaded archives.This is
	   equivalent to setting $OPAMNOCHECKSUMS to "true".

	   Only	install	the compiler switch, without switching to it. If the
	   compiler switch is already installed, then do nothing.

	   Do not display any warning related to environment variables.

	   Reject the installation of packages that don't provide a checksum
	   for the upstream archives. This is equivalent to setting

       -s, --short
	   Output raw lists of names, one per line, skipping any details.

	   Call	the solver and display the actions. Don't perform any changes.

       -t, --build-test
	   Build and run the package unit-tests. This is equivalent to setting
	   $OPAMBUILDTEST to "true".

       These options are common	to all commands.

       --color=WHEN (absent=auto)
	   Colorize the	output.	WHEN must be one of `always', `never' or

	   Specify user	preferences for	dependency solving for this run.
	   Overrides both $OPAMCRITERIA	and $OPAMUPGRADECRITERIA. For details
	   on the supported language, and the external solvers available, see A
	   general guide to using solver preferences can be found at The default value
	   for upgrades, and

	   Debug option: Save the CUDF requests	sent to	the solver to

	   Print debug message to stderr. This is equivalent to	setting
	   $OPAMDEBUG to "true".

	   Like	`--debug', but allows specifying the debug level (`--debug'
	   sets	it to 1). Equivalent to	setting	$OPAMDEBUG to a	positive

	   Print the git version if it exists and exit.

       --help[=FMT] (default=pager)
	   Show	this help in format FMT	(pager,	plain or groff).

	   Do not install base packages	(useful	for testing purposes). This is
	   equivalent to setting $OPAMNOBASEPACKAGES to	a non-empty string.

	   OPAM	will replace itself with a newer binary	found at OPAMROOT/opam
	   if present. This disables this behaviour.

       -q, --quiet
	   Be quiet when installing a new compiler.

       --root=ROOT (absent=~/.opam)
	   Use ROOT as the current root	path. This is equivalent to setting

	   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

	   Specify the name of the external dependency solver. The default
	   value is aspcud. Either 'aspcud', 'packup' or a custom command that
	   may contain the variables %{input}%,	%{output}% and %{criteria}%

	   Fail	whenever an error is found in a	package	definition or a
	   configuration file. The default is to continue silently if

	   Use SWITCH as the current compiler switch. This is equivalent to
	   setting $OPAMSWITCH to SWITCH.

       --use-internal-solver, --no-aspcud
	   Force use of	internal heuristics, even if an	external solver	is

       -v, --verbose
	   Be more verbose, show package sub-commands and their	output.	Repeat
	   to see more.	Repeating n times is equivalent	to setting
	   $OPAMVERBOSE	to "n".

	   Show	version	information.

       -y, --yes
	   Disable interactive mode and	answer yes to all questions that would
	   otherwise be	asked to the user. This	is equivalent to setting
	   $OPAMYES to "true".

       OPAM makes use of the environment variables listed here.	Boolean
       variables should	be set to "0", "no" of "false" to disable, "1",	"yes"
       or "true" to enable.

       OPAMCOLOR, when set to always or	never, sets a default value for	the
       --color option.

       OPAMCRITERIA specifies user preferences for dependency solving.The
       default value is
       See also	option --criteria

       OPAMCURL	can be used to select a	given 'curl' program. See OPAMFETCH
       for more	options.

       OPAMDEBUG see options `--debug' and `--debug-level'.

       OPAMDOWNLOADJOBS	sets the maximum number	of simultaneous	downloads.

       OPAMEXTERNALSOLVER see option `--solver'.

       OPAMFETCH specifies how to download files: either `wget', `curl'	or a
       custom command where variables %{url}%, %{out}%,	%{retries}%,
       %{compress}% and	%{checksum}% will be replaced. Overrides the
       'download-command' value	from the main config file.

       OPAMJOBS	sets the maximum number	of parallel workers to run.

       OPAMLOCKRETRIES sets the	number of tries	after which OPAM gives up
       acquiring its lock and fails. <=	0 means	infinite wait.

       OPAMNO answer no	to any question	asked.

       OPAMNOASPCUD see	option `--no-aspcud'.

       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.

       OPAMPINKINDAUTO if set, version control systems are detected when
       pinning to a local path.

       OPAMREQUIRECHECKSUMS see	option `--require-checksums'.

       OPAMRETRY sets the number of tries before failing downloads.

       OPAMROOT	see option `--root'. This is automatically set by `opam	config
       env --root=DIR' when DIR	is non-default or OPAMROOT is already defined.

       OPAMSAFE	see option `--safe'

       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
       compatibility testing only.

       OPAMSOLVERTIMEOUT change	the time allowance of the internal solver.

       OPAMSTATUSLINE display a	dynamic	status line showing what's currently
       going on	on the terminal. (one of one of	`always', `never' or `auto')

       OPAMSWITCH see option `--switch'. Automatically set by `opam config env

       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
       are set.The default value is
       See also	option --criteria

       OPAMUSEINTERNALSOLVER see option	`--use-internal-solver'.

       OPAMUTF8	use UTF8 characters in output (one of one of `always', `never'
       or `auto'). By default `auto', which is determined from the locale).

       OPAMUTF8MSGS use	extended UTF8 characters (camels) in OPAM messages.
       Implies OPAMUTF8. This is set by	default	on OSX only.

       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.

       OPAMVERBOSE see option `--verbose'.

       OPAMYES see option `--yes'.


       Thomas Gazagnaire <>
       Anil Madhavapeddy <>
       Fabrice Le Fessant <>
       Frederic	Tuong <>
       Louis Gesbert <>
       Vincent Bernardoff <>
       Guillem Rieu <>
       Roberto Di Cosmo	<>

       Check bug reports at

Opam 1.2.2							OPAM-SWITCH(1)


Want to link to this manual page? Use this URL:

home | help