Lesson 4: Channel Priority and Best Practices
How Conda resolves packages
Section titled “How Conda resolves packages”When you install a package, Conda searches channels in order. The first channel that provides a compatible package is used. This is why channel priority matters.
If the channel order is not consistent, you can get incompatible builds or dependency conflicts.
Best practice for bioinformatics
Section titled “Best practice for bioinformatics”A common and reliable channel order is:
conda-forgebioconda
This ensures that bioconda packages use dependencies from conda-forge.
Note: Many bioinformatics workflows avoid the
defaultschannel to reduce licensing risk and dependency conflicts.
Remove the defaults channel
Section titled “Remove the defaults channel”This command removes defaults from your channel list.
conda config --remove channels defaultsAdd conda-forge
Section titled “Add conda-forge”This command adds conda-forge at the top of your channel list.
conda config --add channels conda-forgeAdd bioconda
Section titled “Add bioconda”This command adds bioconda below conda-forge.
conda config --add channels biocondaEnable strict channel priority
Section titled “Enable strict channel priority”This command forces Conda to use the highest-priority channel possible for each package.
conda config --set channel_priority strictVerify channel order
Section titled “Verify channel order”This command shows your configured channels. The expected order should place conda-forge before bioconda.
conda config --show channelsExpected output order:
channels: - conda-forge - biocondaIf you find that bioconda is above conda-forge, you can run the following command to fix the order:
conda config --add channels conda-forgeThis will move conda-forge to the top of the list, ensuring that it has higher priority than bioconda.