Fedora

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.

Original content from computingforgeeks.com - post 66122

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:

Related Articles

Desktop Things to Do After Installing Fedora 42 Workstation Terminal Installing Alacritty Terminal on Ubuntu 24.04|22.04|20.04 Fedora Installing Fedora 42-Step-by-Step Guide With Screenshots Containers Configure Kubernetes prompt for bash and zsh using kube-ps1

Leave a Comment

Press ESC to close