I have removed flatpak with sudo apt-get purge flatpak; however, if I run locate flatpak I find several files and several directories. Can I remove them all with rm -r or there is a "better" way? If so, how do I have to do that?


Since my output is 21909 rows long and, as @mook765 noted, nobody will ever be so crazy to read them all I think I should reformulate the question as follows: if I had a normal installation of flatpak, what would be the best way to remove it and all its files and folders?

  • Nope, your way will work fine. Sep 16, 2019 at 18:53
  • You shouldn't do that! Without seeing the output of your command locate flatpak it's impossible to give better advice.
    – mook765
    Sep 16, 2019 at 18:57
  • Do I have to add the full output of the command? It is 21909 rows. Note that I just want to remove every file and directory left by flatpak...
    – Ntakwetet
    Sep 16, 2019 at 19:13
  • That's a lot. Remove them on your own risk. No one of us will go through 21909 rows of output...
    – mook765
    Sep 16, 2019 at 19:24

2 Answers 2


I'm assuming you didn't uninstall the run times that flatpak applications require. I would recommend reinstalling flatpak and running the following commands:

flatpak uninstall --unused

sudo apt-get remove --autoremove flatpak

sudo apt-get purge flatpak

This should erase the majority of the files left behind from flatpak. I had around 4000 after trying it out. I decided it wasn't for me and had to look for a few hours to find a way to remove the majority of the files. These three commands had reduced nearly 4000 files that dealt with flatpak to 197.

Hope this helps.


Flatpak applications and runtimes aren't removed when you uninstall the flatpak package using apt.

I'd rather reinstall flatpak, use it to remove any leftover Flatpak packages, and then purge it. On Ubuntu 20.04 Focal:

$ sudo apt install flatpak
$ flatpak uninstall --all
$ sudo apt purge --autoremove flatpak

You can look at /var/lib/flatpak/ to check that everything has been removed. You may also need to reboot or logout/login to update application launchers.

  • 1
    If apps were installed at user space, some files could be on ~/.local/share/flatpak (immutable) and ~/.var/app/ (config) Sep 16, 2022 at 6:03
  • flatpak uninstall --all results in unknown option -all The above answer worked for me
    – Ricky
    Aug 21 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .