Adding or removing software repositories in Fedora

This page has been converted from the Fedora Project Wiki and cleaned up for publishing here on the Fedora Docs Portal, but it has not yet been reviewed for technical accuracy. This means any information on this page may be outdated or inaccurate. Reviews for technical accuracy are greatly appreciated. If you want to help, see the README file in the source repository for instructions.

This section describes how to add, enable, or disable a software repository with the DNF application.

Adding repositories

This section describes how to add software repositories with the dnf config-manger command.

Use the following commands as the root user or under the sudo utility.

  1. Define a new repository by adding a new file with the .repo suffix to the /etc/yum.repos.d/ directory. For details about various options to use in the .repo file, see the f{MAJOROSVER}@fedora:system-administrators-guide:package-management/DNF.adoc#sec-Setting_repository_Options section in the System Administrator’s Guide

  2. Add the newly created repository.

    # dnf config-manager --add-repo repository

    Replace repository with the path to the created .repo file, for example:

    # dnf config-manager --add-repo /etc/yum.repos.d/fedora_extras.repo

Enabling repositories

This section shows how to enable a particular software repository by using the dnf config-manager command.

Procedure

  • To enable a particular repository, use the following command as root.

    # dnf config-manager --set-enabled repository

    Replace repository with the unique repository ID, for example:

    # dnf config-manager --set-enabled fedora-extras

Disabling repositories

This section shows how to disable a particular software repository by using the dnf config-manager command.

Procedure

  • To disable a particular repository, use the following command as root:

    # dnf config-manager --set-disabled repository

    Replace repository with the unique repository ID, for example:

    # dnf config-manager --set-disabled fedora-extras