Posts

Showing posts from 2024

Setting cachedir with DNF5

On Fedora (and other systems that use DNF for package management), we can set the directory used by DNF for cache data. Combined with keepcache setting, this can be used to collect all RPM packages downloaded by DNF. Then one can just copy these files to another computer without Internet access and use them to install/update packages on that machine. The configuration file for DNF used to be /etc/dnf/dnf.conf . I used to have the following two settings in my dnf.conf file: [main] cachedir = /my/cache/dir/path keepcache = True But after I installed Fedora 41, which has DNF5 , I found that setting cachedir was not having any effect. Usually, when you do a ' sudo dnf update ' command, you could see repository data getting created in the cache directory. But for some reason, this was not happening. Digging around DNF5 documentation , I finally figured out the reason. For superuser, the cache directory needs to be set by system_cachedir setting and not cachedir . So my /etc...