What is the purpose of DNF's COPR plugin?

What is the purpose of DNF’s COPR plugin? I understand the purpose of COPR, but not the plugin. I mean, why we just add COPR repos with dnf config-manager/manually? COPR repos are just standard RPM repos and COPR plugin add .repo file to /etc/yum.d/ just like config-manager do?

I assume to make it very easy to add a copr repo.

On my tools repo page (https://copr.fedorainfracloud.org/coprs/barryascott/tools/) it says all you need to do is dnf copr enable barryascott/tools.

You do not need to know the release of arch information that, I guess, you would need to know to add the repo and change on an upgrade.

1 Like

Is it? What’s wrong with something like sudo dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/barryascott/tools.repo?


The plugin helps you do that without knowing the URL. It also helps you manage dependencies (if a copr repo needs another one) and search copr via the API.


I get 404 not found, did you try that or guess?

You can see the required url by adding my copr and looking at the baseurl in the .repo that dnf adds. (I am not near a fedora system to copy the url)

I think he was guessing on what the url would be.
When I used the copr command I saw
Do you really want to enable copr.fedorainfracloud.org/barryascott/tools? [y/N]: y
and the repo file shows a different baseurl

It was just guess. The right URL is https://copr.fedorainfracloud.org/coprs/barryascott/tools/repo/fedora-38/barryascott-tools-fedora-38.repo as the page of your repo says.

You can add your repo three ways:

echo -e "[copr:copr.fedorainfracloud.org:barryascott:tools]\nname=Copr repo for tools owned by barryascott\nbaseurl=https://download.copr.fedorainfracloud.org/results/barryascott/tools/fedora-$releasever-$basearch/\ntype=rpm-md\nskip_if_unavailable=True\ngpgcheck=1\ngpgkey=https://download.copr.fedorainfracloud.org/results/barryascott/tools/pubkey.gpg\nrepo_gpgcheck=0\nenabled=1\nenabled_metadata=1" | sudo tee /etc/yum.repos.d/_copr\:copr.fedorainfracloud.org\:barryascott\:tools.repo
sudo dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/barryascott/tools/repo/fedora-38/barryascott-tools-fedora-38.repo
sudo dnf copr enable barryscott/tools

I think the reason is managing many repositories for testing. It’s like package repo manager. You add repo hub and install packages add repositories. This works because usually these testing repositories are hosted on public hub/service, since every random guy doesn’t want host by own.

Think about: COPR is basically just for hacking/testing. We don’t one huge testing repo to where any random guy can put anything. So every guy need own repo. That repo usually contain just a few package and testers want add many repos and then copr plugin comes in. You can search with dnf copr search and add repositories easy with dnf copr enable.

So, I think now, the plugin is very cool and useful. I was worried when I thought that copr plugin try make copr.fedorainfracloud.org something centralized system that is bolted to Fedora Linux by default… but I can add every hub I want (check files /etc/dnf/plugins/copr.conf and /etc/dnf/plugins/copr.d). There is e.g. https://eur.openeuler.openatom.cn.

It also helps you manage dependencies (if a copr repo needs another one)

Tell me more about this :slight_smile:

I think, we have to try keep the API stable/standard. The copr plugin should be able to be used reliably with hub/service that use copr or something else.

@ computersavvy @mjg: Can you answer to this? :sweat_smile:

I think that is related to the fact that once you have enabled a repo using the copr command given above then from that point on dnf is able to use the content of that repo and install provided packages – including the required dependencies that may be involved.

Since I use very few copr repos I cannot be 100% certain, but I do know that a copr repo simply contains rpm packages that were built by that maintainer and that often they are not stand-alone packages but may have other dependencies from the main fedora repo (or even another copr repo) and the wording of that
It also helps you manage dependencies (if a copr repo needs another one)
would imply that if one copr repo required a package from another copr repo it may even be able to enable the second repo for you.

Oh, I tagged you, I meant @mjg (the comment I quoted was from him), but thanks for your answer anyway.

I understand that, but wonder, how copr technically do that? How RPM tell to DNF its need for another copr repo? Usually RPM just mark “I need xyz.fc38.x86_64 package” and dont repo that provides it.

As far as I know the copr system does not have meta data on extra needed repos for install dependencies, there is a way to add extra repos for build dependencies.

When I needed to add 2 related copr repos they where both manually added on my systems.

Yup, hopefully he has time to answer what he meant.


On the copr website for each repo that you create you can add other copr repos as build dependencies.

copr is a build system for rpms, not just a file server.

For example this is one of mine, but you cannot see the setting it seems, only I can: Builds for barryascott/tools

I found this and I got know that copr build system have feature add depency repositories with coprdep: prefix to .repo file. Copr dnf plugin tells to user if .repo file that it download from the hub contain them.

It also helps you manage dependencies (if a copr repo needs another one)

@mjg: Do you mean this?

It seems admin of copr repo can configure .repo file for this, but copr plugin doesn’t know anything about this. Packages doesn’t care about this. Only think is, when you enabling .repo file that contains dependency repos, it tell to you.

I can see your setting at the bottom of this page:

What I meant were several things:

  • One copr repo can provide more than one package, in particular possibly rebuilt or newly built dependencies, and it provides them as a standard yum/dnf repo so that dependencies are resolved automatically.
  • One copr repo can depend on another one during build (the setting you mentioned).
  • I vaguely remembered that you can specify additional repos which your copr repo (packages) depend on. Alas, I couldn’t find that information (any more) and consider it “dubious” now :innocent:
    That last point also explains why I couldn’t just answer quickly …

Copr are package build system that builds RPM packages and distributes them via DNF/YUM repo. Copr plugin speed up adding these repos which are usually located in only a few hubs/services. Copr plugin is Python program that just configure files in /etc/yum.repos.d/ directory.
So DNF sees the repos (that copr plugin added) completely normal and of course package dependencies are treated normally.

What? The feature I told you is about that new packages from copr repo may need dependencies from another repo and simplifying adding those repos. Nothing to do with building.

Now I think that such feature exist. Please read this link, then bottom of this page and then this.
And hey, thanks for your replies!

Just to make sure, this feature that you talking about, is the following?