I have 52GB for / partition and suddenly system informed that it is full. Examination with Disk Usage Analyzer tool revealed there is 18GB cache in /var/tmp/ that belongs to Flatpak.
used command: flatpak uninstall --unused
but 18GB cache is there again
also
used command: sudo flatpak repair
I am not sure this is a application design flaw that can be fixed.
Fedora now uses /tmp as a virtual file system in RAM, but /var/tmp is a physical file system. Some installations seem to actually use /var/tmp as /tmp with a symlink.
I seem to recall that there have been issues with cleaning out /tmp, historically and ongoing, and with having it as a physical file system there seem to always be problems with cleaning it out. (I think this may have been a factor in fedora switching to the virtual file system approach.) It seems the system is supposed to keep /tmp (& /var/tmp) at a reasonable usage when the apps fail to do so.
I agree that it should not continuously fill up but since I do not do development cannot speak to how it could be cleaned out regularly. What about servers that may run for months without ever rebooting? How does /tmp (or /var/tmp) get cleaned out for them?
See man tmpfiles.d. On Fedora, /usr/lib/tmpfiles.d/tmp.conf sets the age of /tmp to 10 days and /var/tmp 30 days, meaning any files older than that are deleted when systemd-tmpfiles-clean.timer runs.
Hi. I’m having same issue flatpak consuming disk space in /var/tmp. Are there any fixes to prevent that happening again and again ? I know I can get rid of cache files by using ‘rm’, but is there a permanent solution ?
flatpak is designed to not keep these temporary caches. On my system, /var/tmp/flatpak-* takes up almost no space immediately after a flatpak transaction. If you monitor the filesystem during a transaction, you can see the temporary repo get created and disappear after it’s copied to the actual install location.
These users may be encountering a bug in flatpak, but without any reproducible steps it’s hard to diagnose.
Also as previously mentioned, /var/tmp is already cleaned regularly, unrelated to flatpak.