Tips on how to keep OS clean

hello, I’m fairly new to Linux, coming from Windows, CCleaner was my weekly ritual. I tried the same routine with Bleachbit on Fedora a few months back. I erased crucial parts of the system and had to reinstall the OS.

now I’m super cautious, but my system still needs occasional cleaning. I’d really appreciate it if you guys could share how you safely use Bleachbit or similar tools on your system and what’s your cleaning routine :slight_smile:

I have never needed to “keep the os clean” on fedora.
Removing packages with dnf had always been clean by design.
What are you expecting this to achieve?

3 Likes

Hi, I would recommenced to use silverblue it is a lot less likely to be damaged by not knowing what can be removed, because main system files are immutable (read only).
Sometimes to remove flatpak packages that are no longer needed I run this command:
flatpak remove --unused
and that is it.

In over 20 years using linux, and fedora specifically, I have never encountered a need to ‘clean’ the OS. What are you seeing that implies it needs cleaned? and what are you trying to achieve?

1 Like

On Windows, many useful 3rd party programs come with installers that include libraries they need. You can quickly end up with multiple copies and different versions of these 3rd party libraries. Windows makes it a priority to continue supporting older software. At one time it was a lottery which version of the 3rd party library would be used, but now there are better mechanisms to ensure that a program uses the appropriate version of a library.

With linux many 3rd party programs are packaged by the distro and use distro libraries, so if you stick with distro packages the installer will ensure you always have “current” library packages. The only times I have needed cleaning was after a version upgrade when the new version provides a different library that obsoletes the old library. After a version upgrade, there are usually packages that have not yet been ported to the current libraries, so the old library has to be kept for those older packages. At some point those packages get updated and the old library is no longer being used. Some linux distro package managers will provide a list of installed packages that are no longer required by any current package.

1 Like

Atomic system, use flatpaks, delete unused flatpak data (using GUI software stores, there is a Flatpak app to do that, or use my script)

Apart from that, you dont need “automatic junk removers”. If your OS needs stuff like that, its bad. The package managers do that on Linux.

You may like Czkawka from Flathub to find duplicate files (from hash, name and other parameters)

1 Like

I can’t say that I’ve experienced any effects on performance or a growing amount of dump files over the short time I’ve used Linux (as would happen on Windows). maybe there’s no need to ‘clean’ Linux as other OSs and that’s just my lack of understanding and old habits.

but if I must stretch it to answer your question, I do always find crumbs and leftover in the Home hidden folders, created by apps I’d installed and later uninstalled.
even though I always tick off the box ‘delete all data’ during the uninstallation process. I don’t suppose these folders are significant in anyway in terms of disk space and I have no problem deleting them manually. I was just wondering if there’s a tool that may do it for me, to spare the hassle.

1 Like

and what about the junk generated by particular software? things such as auto saves, render cache files, backups and what not.

when I used Windows, these things were common amongst graphic art software (I’m currently using Gimp Inkscape Blender and few more).
even the Spotify client (I remember using it on Windows, it’d generate Gigabytes of cache regularly and drain my OS drive! I had to remove it manually before CCleaner officially implemented a Spotify cleaning feature because it really did get very bad).

I suppose I’m less worried about the packages and more by the stuff the programmes I use often generate. these files are created for a single use and then they’re no longer relevant but on windows, they won’t be automatically deleted (not sure about Linux).
most these programmes have an option in their settings to manually erase cache files. CCleaner used to do it all at one go.

I’ve tried Czkawka. it didn’t really seem to look for cache files. also, while it did have a feature that should’ve tackled empty directories, it didn’t seem to remove the directories software that I uninstalled left behind (as I mentioned in a previous comment)

Cache files should be cleaned by your system, do not delete them manually, it makes no sense and will just slow down your PC.

Those files you are talking about are in the user directory and that is very true. They are small, mostly just user configs. But you will not keep them when using flatpaks, because they put those files in their ~/.var/app/org.app.name/ directory which can be deleted (see above). The problem is that not every natively installed program puts those files in the correct directories.

But still, package managers should be able to clean them.

You might try BleachBit but tbh I have not used it and I am not sure if it does intelligent cleaning of app data left from not installed apps.

so if I understood you correctly, when it comes to software generated files, the system takes care of it for me in the background?
this was clearly not the case with Adobe programmes running on Windows :sweat_smile: they’d compile gigs upon gigs of useless crap that mostly had to be removed manually or with CCleaner on occasions. or else, my drive would very quickly get full.

as for the user and config files you’ve mentioned—I’ve encountered it more than once, that folders and few files were left behind after I removed a programme. I can’t recall however if it was only the case with packages that I didn’t source from Flathub. for example, Anytype, that’s still in a beta, is not yet on flathub and only available for direct installation on their website. this app certainly left behind its files and had to be cleared manually by me. not even Czkawka managed to spot them.

the reason I asked for tips about Bleachbit is that it’d do away with whatever you tell it to, no matter how important it is. I’m not sure if it’s able to find such leftover directories of uninstalled apps but it’s very happy to score out anything the system needs to run (if you tick off the wrong boxes and there’s plenty of them, most of which I can’t even understand).

p.s.
Chrome was another app that as far as I recall, I did install from Flathub, I deleted it the same day and found a few directories and files left behind, by running a simple search in Files search bar. I had to erase them manually.

I have used bleachbit for years with no issues but I never run it as root.I use it to clear cache and cookies from firefox and chrome.I also have it set to clear the trash and recent documents list.As was already posted theres really nothing else to clean as the system does a good job of that.You might try checking dnf autoremove once in awhile to see if anything can be removed thats not needed.

1 Like

how do you determine if you run BleachBit via root or not? is it in the app’s preferences?

if I don’t run it as root, it basically doesn’t have sudo permissions, so I shouldn’t be worried that it’ll mess with the system in anyway?
do you mind sharing a screenshot of the boxes you’ve ticked, like, what you allowed it to clean?

thanks for the tip :slight_smile:

In over 20 years of using fedora I have never once to my recollection ever found a significant need to remove the left over bits in my home directory that some apps leave.

Those apps that do create directories or files under a users home directory may leave things behind when removed, but most are sensibly named so that the user can easily run the command l. on fedora to see the hidden files & directories then decide whether to remove those items or not. (l. is a default system defined alias for the ls command with options so it only shows the ‘hidden’ files in the directory being displayed.)

If you think the system may be filling up with leftover data from the apps then the tools du and df may be used with various options to determine exactly what space is used and make your own choices as to what should be removed and if it is even needed.

1 Like

Almost all apps are prevented from writing to or deleting files in the OS when run as a regular user. Thus tools such as bleachbit, when run with only a users rights, should only be able to manipulate data within the home directory of that specific user and not affect the system at all.

Thats all I use bleachbit for.I also have the regular icon to open bleachbit and one that says bleachbit as admin which I have never used.

oh, so when you installed BleachBit via flathub, did you get 2 separate icons, one runs it as admin and the other not?

I installed the rpm from the bleachbit website.

1 Like

I want to stress that good software clears those things on its own. Firefox should know best when cookies etc can be cleared.

Also running RPMs from external sources, not packaged by Fedora and not even in a repo is not secure practice. If it is on Flathub, use that.

1 Like

You can easily see the actual usage of subdirectories & files with du -hs * and for the hidden files and directories with du -hs $(l.)

1 Like