How do I add a repo using dnf?

I’m trying to add an Nvidia repo to troubleshoot USB-C connectivity issues I’ve been having in Fedora 42. Per these two pages:

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/managing_software_with_the_dnf_tool/assembly_managing-custom-software-repositories_managing-software-with-the-dnf-tool

https://negativo17.org/nvidia-driver/#Repository_installation

I’ve tried:

  • dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo
  • dnf config-manager addrepo=https://negativo17.org/repos/fedora-nvidia.repo
  • dnf config-manager addrepo https://negativo17.org/repos/fedora-nvidia.repo
  • dnf config-manager addrepo id=https://negativo17.org/repos/fedora-nvidia.repo
  • sudo dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo
  • sudo dnf config-manager --add-repo https://negativo17.org/repos/fedora-nvidia.repo

These have all resulted in Unknown argument errors pointing at the add-repo/addrepo command and/or the .repo url. What’s the correct syntax here?

DNF5 config manager reference.

1 Like

Solved

Command needs to be sudo dnf config-manager addrepo --from-repofile=https://negativo17.org/repos/fedora-nvidia.repo per new standards

1 Like