DNF Configuration

With arrival of Fedora 22, dnf has become the distro’s default package manager, by replacing legacy yum package manager. For those of you who didn’t know, dnf has been part of Fedora all the way back from Fedora 18.
dnf has been proven to be faster than yum, and is better and faster in handling dependencies.

Configuration of dnf :

TBH, I find the default configuration of dnf pretty horrendous. So, I took the time to go through the documentation and configure a optimum dnf config file applicable to anyone, the dnf config file can be found at /etc/dnf/dnf.conf

1. clean_requirements_on_remove: Use this option if you want to delete unused dependencies when
you run dnf remove.

    e.g. clean_requirements_on_remove=true

2. debuglevel: Use this when you want to have more of debug data printed out to stdout, when any transaction fails.

    e.g. debuglevel=2 (range of 0-10)

3. keepcache: We definitely need this value set to true. This value was set to true by default in yum. Basically what it does, is it preserves your downloaded packages if, in case your transaction fails or quits due to connectivity issues.

    e.g. keepcache=true

If you start to run out of data due to cache you can just sudo in and delete all the cache data, its harmless.

4. deltarpm: Delta RPM packages contain the difference between an old and a new version of an RPM package. Applying a delta RPM on an old RPM results in the complete new RPM. Always set to true. Using delta RPM takes CPU and I/O cycles though.

    e.g. deltarpm=true

5. metadata_expire: Set to -1 as I don’t live on the bleeding edge and don’t want to download 20-30Mb of metadata everytime I want to install a package. Another alternative to this is to use the command line flag -C while executing dnf, this will force dnf to use the system cache even if the metadata is expired.

    e.g. metadata_expire=-1 (-1 for never or time in seconds for between expirations)

6. fastestmirror: Set to true to override the repo default metrics and prefer the fastest mirror first.

    e.g. fastestmirror=true

Comments