Mirroring channels#
The conda configuration system has several keys that can be used to set up a mirrored context.
The default setup#
By default, conda can serve packages from two main locations:
repo.anaconda.com: this is wheredefaultspoints to by default. The default value has been marked for pending deprecation as of conda 24.9.0, but it is still the default for older versions. In conda 25.3.0, this default will be removed.- This base location is hardcoded in the default value of
default_channels: https://repo.anaconda.com/pkgs/mainhttps://repo.anaconda.com/pkgs/rhttps://repo.anaconda.com/pkgs/msys2
- This base location is hardcoded in the default value of
conda.anaconda.org: this is where conda clients look up community channels likeconda-forgeorbioconda. This base location can be configured viachannel_alias.
So, when it comes to mirroring these channels, you have to account for those two locations.
Mirror defaults#
Use default_channels to overwrite the default configuration. For example:
default_channels:
- https://my-mirror.com/pkgs/main
- https://my-mirror.com/pkgs/r
- https://my-mirror.com/pkgs/msys2
Mirror all community channels#
Redefine channel_alias to point to your mirror. For example:
channel_alias: https://my-mirror.com
This will make conda look for all community channels at https://my-mirror.com/conda-forge, https://my-mirror.com/bioconda, etc.
Mirror only some community channels#
If you want to mirror only some community channels, you must use custom_channels.
This takes precedence over channel_alias. For example:
custom_channels:
conda-forge: https://my-mirror.com/conda-forge
With this configuration, conda-forge will be looked up at https://my-mirror.com/conda-forge.
All other community channels will be looked up at https://conda.anaconda.org.
Note
Feel free to explore all the available options in Configuration.