So I have previously uninstalled Flathub repo version of Bottles, Heroic, Lutris, Beyond All Reason, Flight Gear, Whalebird, Microsoft Edge (this was uninstalled awhile back on F37).
It appears there are large residual files still kept after uninstalling within ~/.var/app
Ive also uninstalled Epic Game Store and Heroic but both folders remain ~/Games
It does not appear to be just F38 uninstalled apps but also those uninstalled in F37.
I am unclear if there is a command would remove all these but also if when I uninstall if I am missing something.
To uninstall, i do so, via Gnome Software App and it is showing the app isnât installed
I can manually delete the folders and files, but I am assuming when you uninstall via the App store, it would remove the files. On Windows, I previously used CCleaner to find old residual items to remove and clean up disk, registry etcâŚ
Happy to be corrected if this the expected behavior or any guidance if I need to do something to fix this.
No, it doesnât. Uninstalling a package removes all files and folders that were installed or created when you installed it, and only those files and folders. If you want those files/folders that were created by the package itself removed, you need to do it yourself, just as you did in Windows.
Thanks @sideburns - so rather than uninstall via the Gnome Software App, it would be therefore be better practice to do using a different method, which would remove all files/folders created/installed by the app.
In the meantime, Iâve installed Czkawka from the Software store to try out
any recommendations on what commands to use when uninstalling to completely remove or any guidelines on best practices going forward please?
There are no ways to have the automatic installer uninstall the data/config files that the app creates. Those are located in/under the users home directory and it is up to the user to remove those file when no longer needed. This is what you were told above and it remains true in almost all cases.
If you wish an app to remove all the files it has created before uninstalling then it seems reasonable to contact the app developer and work with them to figure out how that may be done.
Installing an app creates/installs certain files and the installer can remove those same files.
Running the app may create additional files and those are the ones the installer has no knowledge of and cannot remove. Only the app knows what those files may be.
As a kludge to potentially assist you may be able to do a tree or an âls -Râ of the home directory before installing an app, then after removing that app repeat the âls -Râ and look for differences that may have been created. This would only work cleanly if there were only one app installed, used, then removed before the second run since each app may create its own files.
There are also tools that, while extreme overkill, could be used to detect changes in the users home directory and might allow one to identify new files created. This site talks about some of them, but they are mostly intended to detect and prevent system changes on servers, not in a users home directory which is usually quite dynamic.
There are some exceptions, but generally on Linux:
Package managers only remove files that are part of the package.
Files created by programs after you use them are not part of the package.
This means reinstalling a package usually does nothing, since it removes and installs exactly the same files. Donât reinstall packages hoping it will magically fix issues like on Windows. If you want to âresetâ a program, temporarily remove its config files in your home directory.
Package managers never touch usersâ home directories.
Package managers are run at the system-wide level with root permissions. If they removed files from home dirs, then all users would lose files without warning when one admin removed the package (or only the user issuing the uninstall command loses their files, which doesnât make sense either). So regardless of distro policies, package managers should not touch home dirs in normal use.
Flatpak is different from traditional package managers like dnf or apt. Many (but not all) Flatpak apps store their data in isolated folders in ~/.var/app instead of mixed in your home folder.
Because of this, you can delete an appâs data folders when you uninstall it:
flatpak uninstall --delete-data <app id>
See man flatpak-uninstall.
Make sure there arenât files you want in the appâs data folder though, like documents, screenshots, saved games etc. Files outside of the data folder still wonât be removed.
There is no âbest practiceâ for cleaning up files, because thereâs no way to know which files you consider important.
It may seem obvious to you that the games should be removed when you uninstall the launcher. But say you use a program like LibreOffice to create documents. How would a package manager 1) track the files created by programs, and 2) differentiate between files that you consider important (like documents), and files you consider junk (like games after youâre done playing them)?
I donât recommend using any âcleanerâ type apps on any OS. At best, some of their advertised benefits are placebos. At worst they could cause problems deleting the wrong files or deleting files unnecessarily. For example, many programs use caches to speed up repetitive operations. Deleting the cache of a program doesnât improve its performance or save you any space, because the next time you use the program, it will have to spend more time to recreate the cache.
Czkawka is not one of those âcleanerâ apps though. Itâs a duplicates finder which has many legitimate uses (like finding duplicate photos in albums).