Heavy flatpak usage of /var

Hello,

before upgrading from F42 to F43 I always check if there is enough disk space. Actually my /var partition seems to be filled up by flatpak. /var/lib/flatpak is using about 18 GB although there is only a few applications that are run by flatpak:

[21:39:02]\jojo@waldflatpak list --columns=name,runtime,size                                               Runtime                                              Installed size
Fedora Platform                                                                                           1,3 GB
Mesa                                                                                                    384,5 MB
Mesa                                                                                                    347,4 MB
fedoraproject platform translations                                                                       2,0 GB
Intel                                                                                                    46,7 MB
nvidia                                                                                                   93,2 kB
Freedesktop Platform                                                                                    659,3 MB
Mesa                                                                                                    428,3 MB
Mesa (Extra)                                                                                            428,3 MB
nvidia-575-64-05                                                                                        877,0 MB
nvidia-580-105-08                                                                                       901,8 MB
nvidia-580-119-02                                                                                       901,8 MB
nvidia-580-82-07                                                                                        901,6 MB
nvidia-580-82-09                                                                                        901,6 MB
nvidia-580-95-05                                                                                        901,8 MB
Intel VAAPI driver                                                                                       43,5 MB
Nvidia VAAPI driver                                                                                     100,4 kB
Codecs Extra Extension                                                                                   43,6 MB
Extensions                                         org.fedoraproject.Platform/x86_64/f43                641,5 kB
GNOME Sudoku                                       org.fedoraproject.Platform/x86_64/f43                  2,0 MB
Five or More                                       org.fedoraproject.Platform/x86_64/f43                  3,4 MB
Signal Desktop                                     org.freedesktop.Platform/x86_64/25.08                510,2 MB

Esp. /var/lib/flatpak/repo objects and /var/lib/flatpak/runtime are using this disk space. How can I determine what is obsolete? How can I clean up?

Thank you in advance,
Jochen

I’d start with removing any unused runtimes:
flatpak remove --unused

2 Likes

You seem to have a lot of space occupied by obsoleted versions of the nvidia runtimes. It would appear that you have the current latest nvidia driver (580-119-02) installed so all the older versions of that runtime could be removed and would free up ~4.5GB space.

The command given above may do that for you, or you may need to explicitly select each.
The command flatpak remove --help will show several possible options that can be used.

Thank you for the hints.
I tried several commands:

[11:54:04]\jojo@waldstadion:~$ flatpak remove --unused
Nothing unused to uninstall
[11:54:25]\jojowaldstadion:~$ flatpak remove --app org.freedesktop.Platform.GL.nvidia-575-64-05a-575-64-05
error: No installed refs found for ‘org.freedesktop.Platform.GL.nvidia-575-64-05’
[12:01:21]\jojowaldstadion:~$ flatpak remove --app nvidia-575-64-05a-575-64-05
error: No installed refs found for ‘nvidia-575-64-05’

So I was not able to delete/remove ‘nvidia-575-64-05’ which seems to be one of the old drivers. Any idea what might be wrong with my commands?

Can you post
flatpak list --show-details

Name     Description         Application ID     Version                 Branch      Arch   Origin  Installation Ref                                                      Active commit Latest commit Installed size Options
Fedora … Shared libraries    …aproject.Platform 43                      f43         x86_64 fedora  system       org.fedoraproject.Platform/x86_64/f43                    6b893816f4ea  -               1,3 GB       system,alt-i…
Mesa     Mesa compute libra… …atform.CL.default                         f43         x86_64 fedora  system       org.fedoraproject.Platform.CL.default/x86_64/f43         88e427253273  -             384,5 MB       system,alt-i…
Mesa     Mesa graphics libr… …atform.GL.default                         f43         x86_64 fedora  system       org.fedoraproject.Platform.GL.default/x86_64/f43         d1d18159b204  -             347,4 MB       system,alt-i…
fedorap…                     …t.Platform.Locale                         f43         x86_64 fedora  system       org.fedoraproject.Platform.Locale/x86_64/f43             96e71e80b5e1  -               2,0 GB       system,alt-i…
Intel                        …tform.VAAPI.Intel                         f43         x86_64 fedora  system       org.fedoraproject.Platform.VAAPI.Intel/x86_64/f43        2a15396b0227  -              46,7 MB       system,alt-i…
nvidia                       …form.VAAPI.nvidia                         f43         x86_64 fedora  system       org.fedoraproject.Platform.VAAPI.nvidia/x86_64/f43       9c974662c320  -              93,2 kB       system,alt-i…
Freedes… Runtime platform f… …edesktop.Platform freedesktop-sdk-25.08.6 25.08       x86_64 flathub system       org.freedesktop.Platform/x86_64/25.08                    dfcc4edc3668  -             659,3 MB       system,runti…
Mesa     Mesa - The 3D Grap… …atform.GL.default 25.2.6                  25.08       x86_64 flathub system       org.freedesktop.Platform.GL.default/x86_64/25.08         6c84cadce009  -             428,3 MB       system,runti…
Mesa (E… Mesa - The 3D Grap… …atform.GL.default 25.2.6                  25.08-extra x86_64 flathub system       org.freedesktop.Platform.GL.default/x86_64/25.08-extra   de91944ce02a  -             428,3 MB       system,runti…
nvidia-…                     ….nvidia-575-64-05                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-575-64-05/x86_64/1.4  359f55e47531  -             877,0 MB       system,runti…
nvidia-…                     …nvidia-580-105-08                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-580-105-08/x86_64/1.4 328c11362db8  -             901,8 MB       system,runti…
nvidia-…                     …nvidia-580-119-02                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-580-119-02/x86_64/1.4 f2d2d287c33c  -             901,8 MB       system,runti…
nvidia-…                     ….nvidia-580-82-07                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-580-82-07/x86_64/1.4  c29f127eaba3  -             901,6 MB       system,runti…
nvidia-…                     ….nvidia-580-82-09                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-580-82-09/x86_64/1.4  f8f88ba1c4c8  -             901,6 MB       system,runti…
nvidia-…                     ….nvidia-580-95-05                         1.4         x86_64 flathub system       org.freedesktop.Platform.GL.nvidia-580-95-05/x86_64/1.4  acb8b4605d3c  -             901,8 MB       system,runti…
Intel V… VA-API implementat… …tform.VAAPI.Intel                         25.08       x86_64 flathub system       org.freedesktop.Platform.VAAPI.Intel/x86_64/25.08        76a0b136c7a9  -              43,5 MB       system,runti…
Nvidia … VA-API implementat… …form.VAAPI.nvidia                         25.08       x86_64 flathub system       org.freedesktop.Platform.VAAPI.nvidia/x86_64/25.08       3a4014c84eed  -             100,4 kB       system,runti…
Codecs … This extension con… …form.codecs-extra                         25.08-extra x86_64 flathub system       org.freedesktop.Platform.codecs-extra/x86_64/25.08-extra a9564bf207b2  -              43,6 MB       system,runti…
Extensi… Manage your GNOME … ….gnome.Extensions 48.alpha                stable      x86_64 fedora  system       org.gnome.Extensions/x86_64/stable                       9d937bbcdfad  -             641,5 kB       system,alt-i…
GNOME S… Test yourself in t… org.gnome.Sudoku   49.2                    stable      x86_64 fedora  system       org.gnome.Sudoku/x86_64/stable                           d7961eaefef6  -               2,0 MB       system,alt-i…
Five or… Remove colored bal… …nome.five-or-more 48.1                    stable      x86_64 fedora  system       org.gnome.five-or-more/x86_64/stable                     99390a7655e3  -               3,4 MB       system,alt-i…
Signal … Private messenger   org.signal.Signal  7.83.0                  stable      x86_64 flathub system       org.signal.Signal/x86_64/stable                          74723bcd703b  -             510,2 MB       system,curre…

Does flatpak remove org.freedesktop.Platform.GL32.nvidia-575-64-05 work?

No, unfortunately not:

jojo@waldstadion:~$ flatpak remove org.freedesktop.Platform.GL32.nvidia-575-64-05
error: No installed refs found for ‘org.freedesktop.Platform.GL32.nvidia-575-64-05’

Sorry, that probably should’ve been (32 was a typo on my part)
flatpak uninstall org.freedesktop.Platform.GL.nvidia-575-64-05

you could try the entire thing
flatpak uninstall runtime/org.freedesktop.Platform.GL.nvidia-575-64-05/x86_64/1.4

Hello Joe,

it is getting better now :wink:

[14:19:51]jojo@waldstadion:~$ flatpak uninstall runtime/org.freedesktop.Platform.GL.nvidia-575-64-05/x86_64/1.4
Info: applications using the extension org.freedesktop.Platform.GL.nvidia-575-64-05 branch 1.4:
org.gnome.Extensions, org.gnome.Sudoku, org.gnome.five-or-more, org.signal.Signal
Really remove? [y/n]:

I wonder why the listed applications seem to use that specific flatpak, although there is newer drivers installed. Do you suggest to remove anyway?

I would remove them oldest → newest until you’re left with one, making sure applications worked after removal.

There’s an old bug related to this, not sure what the status is .. (it’s from 2019) --unused doesn't remove old NVidia runtime versions · Issue #2718 · flatpak/flatpak · GitHub

1 Like

This is weird. On my system it works as it should - whenever the Nvidia driver is updated, flatpak update installs the new extension and removes the old one, I don’t see this buildup of old versions.

But from what OP is seeing here, it looks like the fix done (in flatpak 1.15.7 according to the Github ticket) doesn’t fix the issue on all systems.

1 Like

Hello Joe,

great! I could remove now all ‘org.freedesktop.Platform.GL.nvidia’ execpt the newest nvidia-580-119-02 . This releases some GB of /var/lib/flatpak/. Thank you!

After that I recognized that 2 other directories on /var use about 5 GB in total:
/var/cache/akmods/nvidia

/var/cache/akmods/nvidia-open (uses 4.3 GB)

Any idea how I could remove some files of /var/cache/akmods/ ? Manually delete the ones of the old driver versions?

I believe you can based on a few searches, but I don’t have an nvidia card. I’d suggest making a new thread for that since that’s a new issue.

Thanks!

1 Like

Have you tried to clean the dnf info
sudo dnf5 clean all which would remove all the dnf cached data – packages, metadata, etc. – that are in /var/cache/libdnf5. Similarly the data in /var/cache/dnf could be cleaned with sudo dnf4 clean all. This is because dnf4 (and the software manager gui) use different cache paths than dnf5.

For /var/cache/akmods it seems that the older logs and locally built rpms are never automatically cleaned out (at least for the current fedora release version) so you certainly should be able to remove those for older kernels and drivers.

I used ls to see what was in /var/cache/akmods/nvidia/ and found 238MB of data in 40 files, half as the kmod rpm and half as the build logs, ranging from the first kernel of f43 while it was still in Beta to the most recent kernel and for all the driver updates during the same period.

I suggest to proceed in this thread:

Yes,
Note that I have participated in both threads.