I have a fedora 41 box, after issuing sudo DNF Update
I received a message
After this operation, 820 MiB extra will be used (install 8 GiB, remove 7 GiB)
Yes/Non?
I only have 5.5G on the OS disk and have another data disk which is 70Gig and 50Gig free.
How can I tell dnf to download the files to the 2nd disk which has spcae?
Thanks in aadvance for your help
When DNF updates a program, it downloads, installs the new and then removes the old.
Setting cachedir should download the update to the set directory or drive, but if there is not enough room for the cache to deploy to before the old version is removed it may fail.
Note this is based on logical thinking rather than experience.
Thus it may be easier to move non system files to the spare drive and keep all system files on the primary drive.
If you don’t find the answer to your question, you can go with repeated sudo dnf upgrade <some-important-package> commands, until you can run sudo dnf upgrade --refresh for the rest of the packages.
Assuming that root is full for legitimate reasons then setting cache dir to where there is space makes a more sense the trying to find space on the root drive.
Vladislav has linked to a great idea to extend the system partition to the extra drive. I can’t and don’t need to test it, but what a cool idea - spreading drives logically over multiple hardware.
My point above was that dnf update keeps, for a very short time, two copies of the files. As I understand it, the cachedir will store the downloaded file, but not the installed files.
Edit: just checked by updating, it goes 1)Download, 2)Verify, 3)Upgrade, 4)Remove
One additional factor that has not been mentioned. Dnf keeps a certain amount of data cached, including some downloaded packages from earlier transactions. If your system has been upgraded from f40 then the cache from dnf4 (which is totally different than the cache from dnf5) may be part of the unnecessarily occupied space.
It is easy to clear that out and see what space is actually available.
(for dnf4) sudo dnf4 clean all
(similarly for dnf5) sudo dnf clean all
Once the cache is cleaned out then you can actually see what space is available with a new attempt to perform the upgrade.