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?
You can use
dnf -Cto run from the cache, which will prevent this — or setcacheonlyin the DNF configuration file. You can also setmetadata_expireto a higher value — the default is 48 hours, or when a dnf configuation or repo file changes (checkcheck_config_file_ageto turn this off).These options are detailed in
man dnf.conf.