Flatpak: [Question] Cleanup Flatpak repo folder

Created on 5 Jun 2019  路  3Comments  路  Source: flatpak/flatpak

Linux distribution and version

elementary OS 5.0 (Built on Ubuntu 18.04.2 LTS)

Flatpak version

Flatpak 1.4.0

Description of the problem

After trying to build the gitg flatpak I noticed my /var/lib/flatpak/repo folder has become very large.
Screenshot from 2019-06-05 <a href="23-34-42@2x">23-34-42@2x</a>
I'm assuming these are build files? Is there a good way to clean these up?

Steps to reproduce

Build the flatpak for a project like gitg.

Most helpful comment

Thanks @julianrichen for the information.

I ran a flatpak uninstall --all and the flatpak/repo stopped taking up significant space. After I then reinstalled the same flatpaks flatpak/repo is now at 6.7GB again.
So it is indeed definitely not build related.

Hopefully this issue will be informative for future users.

All 3 comments

/var/lib/flatpak/ & ~/.local/share/flatpak/ are the system & user install location for installed runtimes (e.g. org.gnome.Platform) and applications (e.g. org.gnome.gitg). The repo/ directory is where all the checksum-ed binary files are stored, it's like a git repo. They are not the build files unless you include the downloaded org.gnome.Sdk//master runtime, which would be installed here. But the SDK is shared and not specific to gitg.

If you built with flatpak-builder they would be in a folder called .flatpak-builder & the build folder (what ever you called it). So if you ran the following in a directory like ~/gitg-build-folder/:

flatpak-builder --force-clean --repo=gitg-repo build org.gnome.gitgDevel.json

Delete ~/gitg-build-folder/build & ~/gitg-build-folder/.flatpak-builder to remove any build files produced during building gitg.

If you don't need to build anything in the future you could delete org.gnome.Sdk//master, however, a lot of the files are de-duplicated as org.gnome.Platform is also installed. You might also have the *.Debug SDK extension installed which would take a lot of space.

Thanks @julianrichen for the information.

I ran a flatpak uninstall --all and the flatpak/repo stopped taking up significant space. After I then reinstalled the same flatpaks flatpak/repo is now at 6.7GB again.
So it is indeed definitely not build related.

Hopefully this issue will be informative for future users.

@julianrichen Could you also share your answer on my duplicate Stackoverflow question: https://stackoverflow.com/questions/56468429/cleanup-flatpak-repo-folder
I could copy your answer from here, but I'd prefer you to get the credits.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JLuc picture JLuc  路  3Comments

LonelyBirb47 picture LonelyBirb47  路  4Comments

rffontenelle picture rffontenelle  路  5Comments

sgnn7 picture sgnn7  路  5Comments

soredake picture soredake  路  3Comments