Install conda

Quick installation guide for conda, along with tips for managing environments.

Install conda

We recommend installing conda using either Miniconda (minimal; faster) or Anaconda (complete distribution).

Updating

Once you have conda installed on your machine, ensure the base installation is up to date. Note that this may require sudo permissions for a shared installation; for example, this can apply when conda is installed into /usr/local/bin/.

Miniconda

conda deactivate
conda update --name="base" --channel="defaults" conda
conda update --name="base" --channel="defaults" --all

Anaconda

Important: Don’t run conda update --all on an Anaconda installation. This can lead to an unstable base environment.

conda deactivate
conda update --name="base" --channel="defaults" conda
conda update --name="base" --channel="defaults" anaconda

.bashrc configuration

As of the conda v4.4 update, the recommended activation configuration has changed. Now a profile script must be sourced in .bashrc:

source "$CONDA_DIR/etc/profile.d/conda.sh"

Previously, up to v4.3, the location of the bin/ directory should be exported into $PATH in ~/.bashrc:

export PATH="$CONDA_DIR/bin:$PATH"

This method is no longer recommended. Source the activation script instead.

My koopa bootloader handles conda activation automatically, and is recommended for deployment across virtual machine instances.

Also, if you prefer zsh over bash, note that conda also supports that shell (refer to the documentation for configuration).

Set up channels

Ensure that bioconda channels are added in the following order:

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

A .condarc file should be created that contains the following:

channels:
  - conda-forge
  - bioconda
  - defaults

Note that the r channel should not be in your .condarc file. This is no longer recommended.

Manging environments

A list of installed conda environments can be obtained with:

conda env list

There are two ways to create (and activate) an environment:

conda create --name="default" shellcheck
conda activate default
conda create --name="default"
conda activate default
conda install shellcheck

Typically I prefer using the first method, but either approaches work.

An environment can be deactivated with:

conda deactivate

Here’s how to remove an environment:

conda env remove --name="default"