Maintenance and cleaning of système

Hello. Please, I'm new to manjaro xfce and linux. My question is what is an application or procedure of maintenance and cleaning of systems like for example c cleaner?
Do we need system cleaning on linux?

The following commands run in a terminal will sync, update and clean your system. The fstrim command trims SSD's only, which is crucial for their daily maintenance.

sudo pacman -Sy

sudo pacman -Syu

sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syyu (once a month or so)

sudo paccache -rvk3 (this deletes all but retains 3 caches packages

sudo pacman -Qdtq (if it returns a list of packages, they're orphaned packages, run below the command to autoremove)

sudo pacman -Qdtq | sudo pacman -Rs -

sudo fstrim -v / 

sudo fstrim -v /home

Bleachbit: sudo pacman -S bleachbit a generic GUI cleaner, old school enthusiasts compare it to a wrecking ball. So use with care and prudence.

:wink:

5 Likes

https://wiki.manjaro.org/System_Maintenance

If you are new to Linux and Manjaro, I recommend you to use Pamac GUI for all system maintenance. You can refresh database, clear cache, remove orphans if you really don't need them. Its user friendly and safe to use.

I wouldn't recommend Bleachbit, except you really have good experience, and know what to remove. Like @mack said, if you use it, use it with care and prudence. :slightly_smiling_face:

Welcome to Manjaro and Linux community. You will see, that Linux doesn't require that much maintenance, and need of many 3rd party applications to keep it "clean".

2 Likes

Please dont do this unless you really really have some specific reason.
Its also rendered redundant if followed by the (more correct)
sudo pacman -Syu

This is probably not a great idea as it takes no user input and just removes all packages deemed 'orphans'. That doesnt necessarilly mean you dont want them. (also .. you may wish to use Rns for removing packages)

This is again redundant, unless you have /home on a separate partition.
Also - this trim command is only useful on SSDs .. and only if you do not have an automated service doing the trimming.

7 Likes

@cscs
@mack
Think you.
But I only want to clean the system of temporary files, cookies, unusable file that can slow down the system. Like ccleaner

Then you most likely just need to take care of your browser (clear its history/cookies/+) and use

paccache -rvk3

from time to time, and also stay on top of pacnews and pacsaves... and if you have a giant log size you can check and clean with:

journalctl --disk-usage
journalctl --vacuum-size=50M

something like ccleaner isnt really required .. but the closest thing to it (and again it is potentially dangerous .. so do not select experimental options, and do not run as root) would be bleachbit.

1 Like

Think you @cscs @glitchdot @mack

Oh yeah .. I forgot .. you can also keep an eye on, inspect, and/or clear out your home .cache folder.
This folder is used for downloaded content, to speed things up, thumbnails, etc.
But it can become large, and sometimes even programs that have been removed have left their cache folders in there. It may be advisable to inspect and only delete items you are sure about. But it is generally considered safe to nuke the whole thing.

This will sort the contents and folders and report size in Mb.

du -sm ~/.cache/* | sort -n

This would delete a corresponding folder (in this example thumbnails)

rm -rf ~/.cache/thumbnails

This would delete everything in the .cache folder

rm -rf ~/.cache/*

Similarly, if you use an AUR helper .. it may keep a cache as well. This totally depends on the helper and its configuration. But for example, yay has a clear cache option:

yay -Sc
3 Likes

Yes thank you that's what I'm looking for. To optimize the system and eliminate unnecessary cache and files. Thank you @cscs

Thanks to this thread I have now updated the wiki with some extra information:

https://wiki.manjaro.org/index.php?title=System_Maintenance

6 Likes

Huh. Also.. I stumbled upon 'sweeper' which is a KDE utility and seems to safely automate removal of things like thumbnail cache, clipboard history, command history, etc.. as well as browser cruft:

2 Likes

Does this kde utility kde work on xfce @cscs

Does this kde utility kde work on xfce

If I used XFCE and was interested to know that, I'd just try installing and running it. Most KDE applications work on other DEs, and I'm guessing this one will at least clean the web cache. Some features could be broken (my guess would be cleaning the lists of recent documents and recent applications, clipboard contents, things like that, which are specific to KDE), but who knows? If you're interested in using it, you could give it a try. If it is unusable/broken, just uninstall it.

1 Like

You might want to use pacui utility, which includes some maintenance actions.

2 Likes

I tested the sweeper application on manjaro xfce. Sweeper is a cache and history cleanup application, but only for kde apps

Somewhat relevant: https://forum.manjaro.org/t/linux-humor/30341/3166 :joy:

I use bleachbit as non-root with the following settings (click to enlarge):

I have never encountered any problems with the above settings. Please feel free to comment and advise if there is anything I should be more careful about.

1 Like

I also tested it but I chose only the settings cache, cookie, history.

1 Like

IIRC the most dangerous are the 'free disk space' 'localizations' and definitely 'memory'.
Maybe avoid 'deep scan' section too. (custom is most likely doing nothing unless you defined it)
What you have here is probably safe.
(but as its automated without prompts .. you can never be totally sure)

3 Likes

Thanks for the confirmation! I never run bleachbit with those options enabled.

1 Like

Forum kindly sponsored by