quick-docs/modules/ROOT/pages/adding-or-removing-software-repositories-in-fedora.adoc

98 lines
2.6 KiB
Text
Raw Normal View History

2018-01-21 13:48:48 +00:00
= Adding or removing software repositories in Fedora
Anthony McGlone
:revnumber: F37
:revdate: 2023-01-05
:category: Administration
:tags: How-to DNF Application Software-Installation
//:page-aliases:
include::partial$attributes.adoc[]
[abstract]
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-manager` command.
* To add a new repository, do the following as `*root*`.
. Define a new repository by adding a new file with the `.repo` suffix to the [filename]`/etc/yum.repos.d/` directory. For details about various options to use in the `.repo` file, see the xref:f{MAJOROSVER}@fedora:system-administrators-guide:package-management/DNF.adoc#sec-Setting_repository_Options[Setting [repository\] Options] section in the System Administrator's Guide
. Add the newly created repository.
+
[literal,subs="+quotes,attributes"]
----
dnf config-manager --add-repo `*_repository_*`
----
+
Where *_repository_* is 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.
* To enable a particular repository, run the following command as `*root*`.
+
[literal,subs="+quotes,attributes"]
----
dnf config-manager --set-enabled *_repository_*
----
+
Where *_repository_* is 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.
* To disable a particular repository, run the following command as `*root*`.
+
[literal,subs="+quotes,attributes"]
----
dnf config-manager --set-disabled *_repository_*
----
+
Where *_repository_* is the unique repository ID, for example:
+
----
dnf config-manager --set-disabled fedora-extras
----
== Removing repositories
This section shows how to remove a Yum repository (or `.repo` file).
[NOTE]
====
If you know the ID of a repository, but you're not sure what `.repo` it belongs to,
you can run the following command [red]#`pass:[grep -E "^\[.*\]" /etc/yum.repos.d/*]`#.
This will print a list of the repository IDs that are associated with each Yum repository.
====
* To remove a Yum repository, run the following command as `*root*`.
+
[literal,subs="+quotes,attributes"]
----
rm /etc/yum.repos.d/*_file_name_*.repo
----
+
Where *_file_name_* is the name of the `.repo` file.