Fix Unknown argument “–add-repo” for command “config-manager” on Fedora

Howdy there maty! Today, we’ll be talking about the changes that came in with the new Fedora 41. A lot of changes came with Fedora 41, but the one we’ll focus on today is the addrepo sub-command, which is used together with the dnf config-manager command. This is a sub-command that we see and use in our day to day lives as administrators of the Fedora Linux distribution.

For Fedora 40 or earlier (DNF 4)

For Fedora 40 or earlier, using dnf4, adding a repository is as simple as a single command on your CLI. First, you define a new repository by creating a new file with the .repo suffix and adding it to the /etc/yum.repos.d/ directory.

You can the add the repository with --add-repo, where repository is the repository URL:

sudo dnf config-manager --add-repo repository

For example, adding the brave browser repo:

sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo

For Fedora 41 or later (DNF 5)

For the case of Fedora 41 and later(dnf5), it couldn’t be any simpler. They a minor change to the subcommand for dnf config-manager and the whole syntax of the command. If you try use dnf4 command you will get an error:

Unknown argument "--add-repo" for command "config-manager" on Fedora

You can the add the repository with addrepo, where repository is the repository URL:

sudo dnf config-manager addrepo --from-repofile=repository

For example, adding the brave browser repo:

sudo dnf config-manager addrepo --from-repofile=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo

Enable and Disable a Repository

Once added, repositories can be enabled or disabled using the setopt subcommand:

Enable a Repository

To enable a specific repository, use:

sudo dnf config-manager setopt repository.enabled=1

Where repository is the unique repository ID. For instance, to enable the brave browser repository, run:

sudo dnf config-manager setopt brave-browser.enabled=1

Disable a Repository

To disable a repository, use:

sudo dnf config-manager setopt repository.enabled=0

Where repository is the unique repository ID. For example, to disable the brave browser repository, use:

sudo dnf config-manager setopt brave-browser.enabled=0

Verify Repositories

To view a list of all enabled and disabled repositories in your system, issue the command belwo:

sudo dnf repolist all

To confirm that the repository is working, try searching or in stalling a package exclusive to that repository. For example:

sudo dnf search brave-browser

The above steps show that adding repositories using dnf config-manager in Fedora 41 is quite easy. By extending the available repositories, you will be able to access a wider range of software and tools that can enhance your Fedora experience.

Check out more articles from our team:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Virtualization is the creation of a virtual version of something, this is achieved by allowing hardware components of a single […]

There are many programming languages available to use. They are used by developers as a way to build programs used […]

A database is a collection of structured data that is organized in such a way that can be easily accessed, […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.