How to clean up config files from unninstalled apps?

After a couple of years, my home folder is full of .config and .local application files that I have no longer installed. I would like to clean them up. Sometimes it’s not easy to tell by the directory name which application it belongs to.
Is there any way to bulk check which of those .config files have no longer the application installed? Or which ones still have the application installed?

3 Likes

That would be possible in case of flatpak, since the user files of each app have its own static directory, but not for globally installed applications. Each program does it’s own stuff. You would a need a database like the one from BleachBit, So bleachbit works to some extent with popular and known apps, but not everything.

1 Like

I tried BleachBit , freed about 800 MB after using Manjaro since 2017 ! Thanks to @megavolt

Also usefull would be “Dealing with Orphaned Packages” See https://wiki.manjaro.org/index.php/Pamac/en

About all these hidden config files in my /home directory. I will delete all that i don’t know where they come from.

Ok, i will think about that again …

Dangerous. If you don’t know where they came from, I’d suggest moving them somewhere safe so you can restore them easily if it turns out they were actually needed.

4 Likes

… the “logic” in some peoples thinking :zipper_mouth_face:

2 Likes

Yes, for Flatpacks I use Flatsweep, which works very nice. I tried Bleachbit and Stacer, but none of them solve my problem. They are good for cache and temp files.
Isn’t there some log file in linux system that contains what application creates what configuration files in the home directory?

Will do a fair amount.
But it wont make assumptions and go hunting in .local or .config excepting for certain known common things like SNAP, Flatpak, java, ruby, cargo, etc.

1 Like

The closest thing to this would be lsof or auditd, see: Audit framework - ArchWiki However, you can only track what the programs open or do, but not whether the folder or file is not used.

You can try to sort by modification date, all directories in .config, and check the oldest ones if they are needed.

Also you can install Mate Disk Usage Analyzer, and check files and directories there, sorted by size.

I think those old files that occupy much space, in Mate Disk Usage Analyzer, are the ones that can be erased, if they are not needed.

I’d think also last access date. Some of these files may not have been modified since initial install, or maybe shortly after when the program was configured.

I think the de facto default mount option for ext4 and the like is to mount with relatime,
I myself use noatime.
So: that wouldn’t work in either case.

The worst thing that can happen is that you lose the config of some app which you actually still have.
Not the end of the world …

1 Like

Indeed; as has been suggested: move the config files, rather than delete; that way they can be put back if it turns out they actually are needed by something.

Yep - that is what I’d do.
I’d create a compressed archive of ~/.config - doesn’t take much space and you can restore should you need or want to.

1 Like

For the benefit of newer users who still think in terms of Windows (generally not a great comparison); this is much like archiving the hidden AppData directory, as ~/.config contains (most of) your user specific application settings.

1 Like