What exactly is happening ?
This is called Metadata Synchronization. When you local dnf metadata is getting expired, dnf tries to download up to date metadata from remote repositories. This process takes some time and costs bandwidth.
How can i avoid this if possible as i have limited data resources.
You can run dnf install
with --cacheonly
, but you may get not most up to date version of package in this case. See documentation:
-C, --cacheonly
Run entirely from system cache, don’t update the cache and use it even in case it is expired.
DNF uses a separate cache for each user under which it executes. The cache for the root user is called the system cache. This switch allows a regular user read-only access to the system cache which usually is more fresh than the user’s and thus he does not have to wait for metadata sync.