linuxterminalfedoradnf

Fedora updating each time I run a dnf command


I have been using Fedora for a while, and I noticed something. Each time I run a dnf command such as sudo dnf install app-pkg or even if sudo dnf remove app-pkg. It first downloads a set of Updates like Fedora x86_64, Fedora Modular x86_64, and a few other updates. Hence, it consumes a lot of time and internet while I use dnf commands.

Is there a way to prevent it from auto-downloading/updating?


Solution

  • You can use dnf -C to run from the cache, which will prevent this — or set cacheonly in the DNF configuration file. You can also set metadata_expire to a higher value — the default is 48 hours, or when a dnf configuation or repo file changes (check check_config_file_age to turn this off).

    These options are detailed in man dnf.conf.