I’m trying to upgrade fedora from fedora 35 to 37. My root partition does not have a lot of free space, but my /home partitiion has 30GB free. So, I need to use my \home partition instead of my root partition when doing “dnf system-upgrade …”. I tried symlinking the directions:
/var/cache/dnf
/var/lib/dnf/system-upgrade
to directoriies in my /home partition. I also tried using the --downloaddir options and tried adding “cachedir” in /etc/dnf/dnf.conf. But it still tells me that it cannot update because there isn’t enough space in the root directory. How can I tell dnf not to use the root partition, but install use my /home partition?
Can you give us a better idea of just how much space is used and needed (e.g., the output from lsblk)?
The cachedir option is a decent approach. Are there (non-RPM) things that you can temporarily move to your /home partition (e.g., maybe you have some large directories under /opt or /srv)?
Beyond that, maybe uninstall a few things.
Also, you might have better luck upgrading just one release version at a time.
I think you will need to shrink your /home and expand your /root
You can find different ways to do that by searching here on the forums or other places.
You might want to consider reinstalling Fedora if you want to be up to date as you will have to go 35>37>39>41 three upgrades to get to the current version, with 42 coming out very soon.
LVM is supposed to make resizing a little easier than it would be with normal partitions. You might have a decent chance of being able to move some of the space that is available under /home to / without too much hassle. However, all your volumes are a bit close to their limits percentage wise. I’d start looking for things to delete or else attach some more storage before trying to update.
Edit: It looks like snap is known for eating a lot of space. You might want to follow this guide first and see if you can free some space by purging old/unused “revisions” that snap keeps by default: How to Clean Up Snap Versions to Free Up Disk Space
I haven’t done it, but just going by the documentation, that cachedir setting in /etc/dnf/dnf.conf should work (make a subdirectory first, e.g., sudo mkdir /home/dnf). However, that is just for the initial download of the files. You will still need space on the final destination filesystem for the installed packages and, because it installs packages before removing them, you will need about twice the total space of all the packages you are upgrading. You have no where near enough space for that right now. You really need to figure out what is eating up all your space and remove it (or at least stash it somewhere). In a pinch, you might delete /var/log/journal. I’m not sure how significant that would be though. Use du -hs <path> to see how much space a directory is using. Don’t just delete directories though unless you know the software can cope with that (systemd-journald can handle /var/log/journal being removed). Before you delete anything, use rpm -qf <path> to make sure it isn’t part of an installed package. If it is part of a package, use sudo dnf remove <package-name> to remove it rather than rm.
Also check for package caches for old Fedora releases under /var/cache/dnf. I think I remember older versions of dnf being bad about leaving things behind under that directory.
Many systems that were updated from f40 to f41 still have the cache for both versions of dnf as well as the cache for the system-upgrade.
Those can be cleaned up with dnf clean all (for dnf5), dnf4 clean all (for dnf4), and dnf4 system-upgrade clean for the system-upgrade cache.
Cleaning up the cache may provide some additional space as well.
The snap parts seem to take a lot of space as previously mentioned
Thx everyone for your help! I was finally able upgrade Fedora! – three times. As was suggested above, I resized my root and /home partition (via lvreduce/lvexpand, but forgeting the -r option initially – opps). I also removed snap (and flatpak), again suggested above. I also followed the suggestions in this article:
which was incredibly useful. After all this, I barely had enough space.