Share your love
Manage Repositories with DNF Config Manager Plugin: 4 Easy Steps
This guide will show you how to Manage Repositories with DNF Config Manager Plugin in RHEL. As you must know, DNF is the default package manager for RHEL-based distros. It can be used to install, update, and remove packages on your distribution.
If you are a RHEL-based Linux user, you must face with DNF Config Manager plugin in your daily tasks. The DNF config manager plugin is provided by DNF Plugins Core and it can be used to manage repositories on your server.
In this guide from the Orcacore website, we want to show you the usage of this plugin with examples.
Table of Contents
Steps To Manage Repositories with DNF Config Manager Plugin in RHEL
To Manage Repositories with DNF Config Manager Plugin, we will use AlmaLinux 9 as our server. Now follow the steps below to complete this guide.
The Dnf config manager will help you to configure the repositories much more easily.
Step 1 – Dnf Config Manager Syntax Command
The syntax of this command is like the following:
dnf config-manager [options] <section>...
Note: If you face the following error:
dnf-config-manager command not found
You must use the syntax correctly. It shouldn’t have the dash after DNF.
The dnf config-manager plugin must be installed by default in the RHEL-Based distros. If you don’t have it, you can install it by using the command below:
sudo dnf install dnf-plugins-core
Now follow the steps below to see how you can Manage Repositories with DNF Config Manager Plugin.
Step 2 – Add Repositories with DNF Config Manager
At this point, you can use this plugin to add your desired repositories. For this purpose, you should use the –add-repo option with your desired URL. This will help you to add your desired repositories on RHEL. For example:
sudo dnf config-manager --add-repo http://www.example.com/myrepo/
Step 2 – Enable Repositories with DNF Config Manager
After adding your repos, you may want to enable them. This plugin will also help you to enable the repositories by using the –set-enabled option with your added repository. For example:
sudo dnf config-manager --set-enabled myrepo
Step 3 – Disable Repositories with DNF Config Manager
At this point, if you plan to disable your repository, you can easily use the –set-disabled option in the command with your enabled repository. For example:
sudo dnf config-manager --set-disabled myrepo
Step 4 – DNF Config-Manager Options
As you saw, this plugin can help you to configure the repositories much easier. To get more options and usage, you can run the following help command:
sudo dnf config-manager --help-cmd
In the output, you should see:
Conclusion
At this point, you have learned to Manage Repositories with DNF Config Manager Plugin. Just remember that when you want to add and enable a repository, use the repository source you trust. Hope you enjoy it. You may be interested in these articles:
AlmaLinux vs Rocky Linux – Choose Better Distribution
How To Install Java with DNF on AlmaLinux 9
How To Install Node.js on AlmaLinux 8
FAQs
What is the DNF config manager plugin?
This plugin helps you to manage repositories in RHEL-based distros much easier including enabling, adding, and disabling repos.
How to Enable the DNF Config Manager plugin?
This plugin is installed and enabled by default. But if you don’t have it, you can use the command below to install it: sudo dnf install dnf-plugins-core