Where are DNF .repo file fields documented?


I’ve read this about adding repositories. It links to this blurb about .repo configuration. But in the actual files of F36 there are many more entries, some of them being of obvious purpose, others such as type or countme needing a bit more info. Where can I find it?

Also, why does skip-if-unavailable equal to False, whereas other true/false flags equal to 1 or 0? Can all of them be in one format, or do they have to be as they are in F36 vanilla .repo files?

$ cat fedora.repo
name=Fedora $releasever - $basearch
1 Like

There is a manual page for that

man dnf.conf

For your last question (also from the manual page):

              This is a data type with only two possible values.

              One of following options can be used: 1, 0, True, False, yes, no

Did you look at the dnf docs too?


To look for man pages, one can also use the apropos command:

apropos dnf

would be a good start.

1 Like

If you’re planning to add a repo, don’t add it to the exisitng repo files. Just create a new file for each new repo in /etc/yum.repos.d/

1 Like

How does one make a leap from repository.repo to dnf.conf? I mean I had no way of knowing that if I look for .repo format I am supposed to look for dnf.conf format. What does this flow from?

Why not?

This is because each repository file is a dnf configuration file. One’s starting point usually is the dnf manual, man dnf, which lists related manuals at the end. dnf.conf is one of them.

Well, you can, but it’s better to have different repo files for different configurations so that they can each be modified independently. It’s best to leave repo files installed by rpms alone, such as the standard Fedora repository files, because they’ll be updated during upgrades etc. If you modify them, they won’t—because Fedora packages do not edit modified repository files.

None of us just “know” this information. We’ve all gone down the path of learning this over time from documentation, and each other. None of us can know what we don’t know, and all that.

System updates may replace an existing .repo file that was installed by an install/update/app while user created/added .repo files are never touched by system updates.

If you are creating an added repo within an existing .repo file it would be frustrating for a system update to remove your changes; or alternatively not receive the updated .repo file should dnf decide to install it as a .repo.rpmnew file instead of actually doing the update.

As noted, dnf is intended to not overwrite modified .repo files so after you modify one it should never be updated by dnf and you would not see the updates until you manually did the file replacement.