=================
Managing channels
=================

Channels are locations where ``conda`` looks for, downloads, and installs packages. Navigator is capable of connecting to a few important conda package hosting providers—  `Anaconda.org <https://anaconda.org>`_, `Anaconda.cloud <https://anaconda.cloud>`_, and Anaconda's enterprise `on-prem Package Security Manager <https://business-docs.anaconda.com>`_—in order to access channels. Navigator can also connect to individual channels that are privately hosted or saved in your own computer files.

When managing channels in Navigator, you can refer to a channel either by its full URL or by its name. For example, let's say you want to look for packages on the "conda-forge" channel of Anaconda.org. Either of these channel variations will look for packages in the same place:

 - By name - conda-forge
 - By URL -- https://conda.anaconda.org/conda-forge

.. note::
    
    Referring to a channel by its name requires that the channel alias be set. By default, it is set to ``https://conda.anaconda.org/``. For more information about channel aliases, see `channel_alias: Set a channel alias <https://docs.conda.io/projects/conda/en/stable/user-guide/configuration/settings.html#channel-alias-set-a-channel-alias>`_ in the conda documentation."

.. caution::

    Most channels on Anaconda.org are completely free to use. However, Anaconda does provide mirrors of four channels that are subject to Anaconda's `Terms of Service <https://legal.anaconda.com/policies/en?name=terms-of-service>`_: main, r, msys2, and anaconda. For more information about Anaconda's TOS, see our `TOS FAQ <https://www.anaconda.com/pricing/terms-of-service-faqs>`_.

.. _navigator-add-channel:

Adding a channel in Navigator
=============================

#. Click **Channels** to open the channels manager.
#. Click **Add**.
   
   .. thumbnail:: ../img/nav-add-channel.gif
      :align: center

#. Enter the channel name or URL and press Enter (Windows)/Return (Mac).
  
   .. note::

      - A channel URL can also contain an access token parameter and value, if necessary.
      - URLs must begin with ``https://`` when entering them into the channels manager.

#. Click **Update channels**.

Adding a channel in your .condarc file
======================================

Since Navigator is built on the conda package manager, you can also add channels to navigator using conda's configuration file: ``.condarc``.

#. To open the ``.condarc`` file in Navigator, open Preferences and then click **Configure conda**. 

   For more information on editing configuration files, see :doc:`Editing Navigator and conda configuration files <editing-config-files>`.

#. To add channels in the ``.condarc`` file, list them under the ``channels:`` setting, similar to the following example:

   .. code-block:: none

      channels:
        - conda-forge
        - defaults

.. note:: 
    
    Navigator searches the channels list in order, starting at the top.

For more information on editing your ``.condarc`` file, see `Using the .condarc conda configuration file <https://docs.conda.io/projects/conda/en/stable/user-guide/configuration/use-condarc.html>`_ and `Settings <https://docs.conda.io/projects/conda/en/stable/user-guide/configuration/settings.html>`_ in the conda documentation.

Deleting a channel
==================

#. Click **Channels** to open the channels manager.
#. Click the trash can |trash| icon beside the channel name.
#. Click **Update channels**.

.. thumbnail:: ../img/nav-delete-channel.gif
   :align: center

.. |trash| raw:: html

   <svg class="inline" width="16" height="16" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512">
      <path
        d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"
      />
   </svg>
