How can I remove a URL channel from Anaconda?

Expanding upon Mohammed’s answer.

All those URLs that you see in your conda info are your channel URLs. These are where conda will look for packages. As noted by @cel, these channels can be found in the .condarc file in your home directory.

You can interact with the channels, and other data, in your .condarc file with the conda config command. For example, let’s say your .condarc file lists the following channels:

channels:
  - https://github.com/mstamy2/PyPDF2/  
  - defaults

Then if we do conda config --get channels we will see returned:

--add channels 'defaults'   # lowest priority
--add channels 'https://github.com/mstamy2/PyPDF2/'   # highest priority

If we then want to remove the github channel we would do conda config --remove channels 'https://github.com/mstamy2/PyPDF2/'. You can also add channels through the --add command so, for example, we could add back that channel with conda config --add channels 'https://github.com/mstamy2/PyPDF2/'.

In this case, since there were several channels to remove, it was probably faster to simply edit the .condarc directly but it’s useful to know how to do it through conda config.

Leave a Comment