Add Ubuntu repository to Conda channel

Asked by At

I have two questions:

  1. How can I add an Ubuntu repository as a Conda channel so I can install packages as I might with sudo apt install <package>?

  2. Is this an erroneous way of approaching Conda?

I'm new to Conda and I'm trying to understand some best practices surrounding Conda environments and channels. I don't exactly have a use case, this is just for my curiosity and I recognize that installing packages in this way (i.e. from an Ubuntu repository) may be foolish or unnecessary.

As an example, I've tried installing ispell in a Conda environment:

$ conda install --channel ispell
Collecting package metadata: failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: ubuntu/dists/xenial/universe
  channel url:
  error code: 404

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

Since is accessible in a browser, I don't understand why error code 404 is returned. I suppose this should have an easy solution and I'm just providing a wrong channel link.

1 Answers

darthbith On Best Solutions

This is an erroneous way of approaching conda. You cannot add an APT repository as a conda channel. Conda channels require a file called repodata.json that is not present in an APT repository, hence the 404. You can read about creating conda channels in the official documentation.