conda-config
Configure Conda settings
TLDR
Show all configuration values
Show current value of a configuration option
Set a configuration value
Remove a configuration value
Append a value to an existing configuration key list
Prepend a value to an existing configuration key list
Describe given configuration option
SYNOPSIS
conda config [-h | --help] [GLOBAL_OPTIONS] COMMAND [ARGUMENTS...]
Common Commands:
conda config --get [KEY ...]
conda config --set KEY VALUE [VALUE ...]
conda config --show
conda config --show-sources
conda config --remove KEY VALUE
conda config --remove-key KEY
conda config --append KEY VALUE
conda config --prepend KEY VALUE
conda config --validate
conda config --describe [KEY ...]
Targeting Config Files:
[--file FILE | --env | --system | --site | --rc-path RC_PATH]
PARAMETERS
-h, --help
Displays a help message for the conda config command and exits.
--get [KEY ...]
Retrieves and displays the current value(s) for the specified configuration KEY. If no KEY is provided, it lists all configurable keys and their current effective values.
--set KEY VALUE [VALUE ...]
Sets a configuration value for the specified KEY. For list-type configurations, this replaces the entire list with the provided VALUE(s).
--show
Displays all active configuration values, aggregated and resolved from all applicable .condarc files in order of precedence.
--show-sources
Lists the paths to all .condarc files that Conda is currently using, along with their order of precedence.
--remove KEY VALUE
Removes a specific VALUE from a list-type configuration KEY. The VALUE must exactly match an existing entry.
--remove-key KEY
Completely removes a configuration KEY and its associated value from the target .condarc file.
--append KEY VALUE
Adds a VALUE to the end of a list-type configuration KEY, preserving existing entries.
--prepend KEY VALUE
Adds a VALUE to the beginning of a list-type configuration KEY, preserving existing entries. This is useful for channel prioritization.
--validate
Checks all .condarc files that Conda finds for valid YAML syntax, reporting any errors.
--describe [KEY ...]
Provides a detailed description of one or more configuration KEYs, including their purpose, type, and default values. If no KEY is given, it describes all known configuration options.
--file FILE
Specifies a particular .condarc FILE to manipulate, rather than the default user, environment, or system locations. Alias: --rc-path.
--env
Directs conda config to write changes to the .condarc file located within the active Conda environment.
--system
Directs conda config to write changes to the system-wide .condarc file (e.g., /etc/conda/.condarc or within the root Conda installation).
--site
Directs conda config to write changes to the site-wide .condarc file. This is less commonly used than user or system files.
DESCRIPTION
conda config is a fundamental command-line utility within the Conda package and environment manager, designed to control various aspects of Conda's behavior. It allows users to view, set, modify, and remove configuration options stored in .condarc files. These configuration files can reside at multiple levels—system-wide, user-specific (typically ~/.condarc), or environment-specific—providing a flexible way to manage settings.
Through conda config, users can customize critical parameters such as channel priorities for package discovery, network proxy settings, SSL verification behaviors, package installation preferences (e.g., always_copy), and update strategies. By manipulating these settings, individuals and organizations can fine-tune how Conda resolves dependencies, sources packages, and interacts with external resources, ensuring compatibility, security, and optimal performance for their development and deployment workflows. It supports various operations like fetching values, setting new ones, appending/prepending to lists, removing entries, and validating configuration files.
CAVEATS
When using conda config, it's crucial to understand the precedence of .condarc files: settings in environment-specific files override user-level files, which in turn override system-level files. Incorrectly configured settings can prevent Conda from finding packages, resolving dependencies, or even starting up correctly. Always be mindful of the scope (user, environment, or system) of the changes you are making. For list-type settings like channels, --set will overwrite the entire list, while --append or --prepend are safer for adding entries.
<I>.CONDARC</I> FILE STRUCTURE
.condarc files are plain text files formatted using YAML (YAML Ain't Markup Language). They contain key-value pairs where keys represent specific configuration settings (e.g., channels, proxy_servers, ssl_verify) and values can be strings, booleans, integers, or lists. It's possible to manually edit these files, but conda config is the recommended tool to prevent syntax errors.
CONFIGURATION PRECEDENCE
Conda loads configuration settings from multiple .condarc files, typically in a specific order: system-level (e.g., /etc/conda/.condarc), user-level (~/.condarc), and environment-level (/path/to/env/.condarc). Settings defined in files loaded later (i.e., environment-level) override those defined in earlier files. For list-type settings (like channels), the behavior can vary; often, entries from higher-precedence files are prepended or merged according to specific Conda logic.
HISTORY
The conda config subcommand has been an integral part of the Conda package manager since its early development by Continuum Analytics (now Anaconda Inc.) in 2012. As Conda grew in complexity and feature set, the need for robust and user-friendly configuration management became paramount. conda config evolved to provide granular control over various aspects of Conda's operation, from channel management and network settings to installation preferences and security parameters. Its design around the YAML-formatted .condarc files ensures a human-readable and portable way to manage configurations across different operating systems and Conda installations, adapting to the growing demands of data science and software development communities.


