Contents of this page:

Empty the trash bin

Clear the updates cache

Delete downloaded packages after installation

Delete Cached Package Files

Clear the thumbnail cache

.cache

.bash_history

rm -rfv ~/.cache/thumbnails

sudo apt-get install dconf-editor

dconf-editor

org - cinnamon - desktop - thumbnail-cache

org - mate - desktop - thumbnail-cache

maximum-age

180

maximum-size

512

The registry

Make Firefox cleanse itself automatically upon quitting

Use custom settings for history

Clear history when Firefox closes

Settings...

Site Preferences

I close Firefox

Browsing history

Consider removing Flatpaks and the Flatpak infrastructure

sudo apt-get purge "*flatpak*"

Tame your Timeshift

Remove most Asian fonts

sudo apt-get remove "fonts-kacst*" "fonts-khmeros*" fonts-lklug-sinhala fonts-guru-extra "fonts-nanum*" fonts-noto-cjk "fonts-takao*" fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica "fonts-tlwg-*" "fonts-lohit-*" fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi "fonts-samyak*" fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai "fonts-telu*" "fonts-wqy*" "fonts-smc*" fonts-deva-extra fonts-sahadeva

sudo dpkg-reconfigure fontconfig

How to undo: re-install removed Asian fonts

dpkg-reconfigure fontconfig

Remove old kernels

Advanced options for Linux Mint

Many old redundant kernels? Remove them all in one stroke

Remove Kernels...

Removal of specific redundant kernels

Remove Kernels...

Automatic removal of old redundant kernels

Automation

Automatic Maintenance

Important warning:

Apply updates automatically

Set a reasonable maximum log size for systemd

systemd

sudo journalctl --vacuum-size=50M

sudo sed -i 's/#SystemMaxFiles=100/SystemMaxFiles=7/g' /etc/systemd/journald.conf

Optional: reduce other system logs

systemd

systemd

sudo rm -v /var/log/*.log* /var/log/syslog*

rsyslog

sudo sed -i 's/rotate 7/rotate 1/g' /etc/logrotate.d/rsyslog

sudo sed -i 's/rotate 4/rotate 1/g' /etc/logrotate.d/rsyslog

rsyslog

sudo sed -i 's/weekly/daily/g' /etc/logrotate.d/rsyslog

logrotate.conf

sudo sed -i 's/rotate 4/rotate 1/g' /etc/logrotate.conf

logrotate.conf

sudo sed -i 's/weekly/daily/g' /etc/logrotate.conf

Turn off the firewall log

sudo ufw logging off

Regrets? Then turn firewall logging on again like this

sudo ufw logging low

Want to get rid of polluted settings in your web browser?

cp -r -v ~/.mozilla ~/.mozillabackup

cp -r -v ~/.config/google-chrome ~/.config/google-chromebackup

bookmarks-xxx.json

rm -r -v ~/.mozilla && rm -r -v ~/.cache/mozilla

rm -r -v ~/.config/google-chrome && rm -r -v ~/.cache/google-chrome

More tips?

As the Victorians used to say: cleanliness is next to godliness. So here are some tips to make your Linux Mint 20 even more divine.First of all two warnings:1.use cleaning applications like BleachBit! Those software wrecking balls are very risky and may damage your system beyond repair . There are a few safe cleaning actions, which I'll describe below.2. Another cleaning pitfall is this: by default, there are two microcode packages installed in your system: one for Intel CPU's and one for AMD CPU's. Don't remove the one you don't need!Both microcode packages are installed as dependencies of the kernel metapackage, so removing one or the other will also remove that metapackage. The other microcode will become a candidate for auto-removal, and future kernel updates will not be offered correctly.OK, now that's out of the way, let's get started:Linux Mint doesn't get polluted much over time. It doesn't even need defragmentation . The only cleansing actions you might want to do in Linux Mint, are the following:1. Maybe too obvious to mention, but still: don't forget to empty the trash bin from time to time. Launch your file manager andclick on the Trash folder - Empty trash. Repeat this in each user account.2. Launch Synaptic Package Manager.Panel of Synaptic: Settings - Preferences - FilesSelect:Press the button:3. For each displayed picture, Mint automatically creates a thumbnail, for viewing in the file manager. It stores those thumbnails in a hidden directory in your user account (names of hidden directories and hidden files start with a dot, likeor. The dot makes them hidden).Over time, the number of thumbnails can increase a lot, up to 512 MB. Moreover, the thumbnail cache will eventually contain many superfluous thumbnails of pictures that don't exist anymore. By default, only thumbnails older than six months will be deleted.The quickest way to get rid of all the thumbnails is to use the terminal for deleting the folder in which they reside. No worries: the system will re-create that folder and its subfolders automatically, the next time that thumbnails will be generated. Proceed like this:Launch a terminal window. Copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter.Repeat the above in each user account.Do you wish to change the settings for thumbnails, so that their maximum size and age are reduced? Then proceed like this (only tested in Cinnamon yet):First install dconf-editor. In the terminal:Press Enter. Type your password when prompted.Press Enter again.Then in the terminal:Press Enter.Expanding the subitems can be done by clicking on the little triangle before an item. In Cinnamon, click your way to:Click once onand then once on, and change it to 90 (for example, if you want 90 days as maximum age).Then click once onand then once on, and change it to 128 (for example, if you want 128 MB as maximum size). Repeat this in each user account. That way, you won't have to pay attention to the disk space of the thumbnails anymore.4. There's no need to clean the registry of Linux, as it can't get polluted in the first place. For the following reasons:- Only the operating system itself has a central registry. The configurations of the applications aren't in there, because they don't have access to it. So they can't mess it up. They place their own default settings in their own folders in the system.- Applications place upon installation a hidden settings file in the personal folder of each user. That's the only settings file that a user has access to. More or less like MS-DOS did, when each application only created its own .ini file with its settings.- Each user has his own hidden copy of the central registry in his personal folder. That copy is the only thing that he can mess up, not the registry of another user account.5. Improve your privacy: you can configure Firefox to cleanse itself automatically, upon quitting. All cookies and history are being deleted then. Furthermore, you can limit the tracking that some websites do to follow you.The price you pay is a small decrease in user friendliness, but it's not much. The privacy gain is huge, and outweighs this price by far.You can do it like this:Firefox menu button (with the three horizontal dashes on it) - Preferences - tab Privacy & Securitya. Item: change the setting to:b. Now tick the following setting:c. Then, click the button(on the right of "Clear history when Firefox closes") and tick everything, except for. Click OK.d. ItemChange the "Accept cookies (...)" setting to:e. Item: remove the tick for:f. Item: leave those settings at their defaults, because otherwise some websites might function less well.You've just set all cookies to be thrown away automatically upon closing Firefox (in the previous steps), so this tracking doesn't impact your privacy by much anyway!g. Close the Preferences tab and you're done with optimizing the settings for privacy.sometimes it may come in handy to force a cleansingyour web browsing. Simply by closing Firefox and launching it anew.6. Flatpak is a cool way of always having the latest stable version of certain applications. But it also has disadvantages: Flatpaks take up much more disk space than ordinary applications from the normal software sources. That's because each Flatpak contains most of its supporting files and shares much less with the system.This use of disk space can also increase quickly, because many Flatpaks are being updated very regularly. This frequent updating also causes a lot of data traffic.So if you don't have much disk space or have to limit your data traffic, you might want to remove all installed Flatpaks and even the Flatpak infrastructure. Like this:a. First launch Software Manager. Then click the Flatpak button (bottom right) and see which applications have a green circle with a white checkmark in it, after their name. Those are the installed Flatpaks. Remove them all.b. After you've removed all installed Flatpaks, close Software Manager.c. You might wish to remove the Flatpak infrastructure as well, in order to prevent installing new Flatpaks by accident. Because Software Manager isn't very clear in showing the distinction between ordinary applications and Flatpaks....For removing the Flatpak plumbing you can proceed as follows:d. Launch a terminal window.e. Copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter. Type your password when prompted. Press Enter again.7. Your hard disk can fill up rapidly, if you use Timeshift for making snapshots of your system. Timeshift is notorious for gobbling up free space: it eats gigabytes like they're nothing. So keep the number of its snapshots down.only remove redundant snapshots within the Timeshift application itself. Don't use your file manager for that job!Practically nobody needs to have more than two snapshots for repairing a broken system. If you wish to automate the creation of snapshots, select a monthly interval with a retention of 2. No more.. Not even the very first snapshot needs to be kept; removing it won't affect the remaining snapshots.The technical explanation is: although Timeshift snapshots are incremental in order to save storage space, each individual snapshot is still fully complete and independent from the other snapshots.That looks like a contradiction, but it's not: Timeshift achieves this by using an advanced feature of the Linux file system (hard links, to be exact). The consequence is that snapshots can always safely be removed in any order.To use an imperfect but helpful analogy, think of it like this: Timeshift's snapshot system behavesit consists of two components. Namely (1) a virtual "local software repository" with a copy of all your system files and (2)of those system files at particular points in time (namely the times at which the snapshots were made).Important to know: each file is copied only once. So, your first snapshot will be roughly the same size as the entire system, which means that it's pretty big....The next snapshot requires space only for its new file list (which is technically a series of hard links) and any additional new files (including updated versions of existing files). Because Timeshift's virtual "local software repository" belongs tosnapshots, you can delete the snapshots in any order. Without ever impairing the integrity of the remaining snapshots.A file is only removed from Timeshift's virtual "local software repository", when all snapshots with that particular file on their lists are deleted. Which means of course, that only deletingsnapshots will also delete all contents of the virtual "local software repository".And it also means that no more than one single snapshot, no matter which one it is, no matter how old or how recent it is, is enough for restoring the system.the above explanation of the workings of Timeshift is only valid for the normal default EXT4 filesystem. If you have selected BTRFS instead, then that's quite a different cup of tea which falls outside the scope of my website.When you're running out of disk space: it makes sense to wipe all existing snapshots from time to time, except for two. Why two? Well, it's an advantage to have one extra snapshot that's at least a month old. Namely in case the system damage you wish to repair by restoring a snapshot, was inflicted before the latest snapshot (which would mean that the latest snapshot contains that damage as well).In case of automatic snapshots, limit the number of kept snapshots to two. Make them with a monthly interval; more frequent than that is usually nonsensical.Barring the rare exception, nobody needs more than two snapshots. Even if the snapshot you restore is quite old: simply run Update Manager after the restoration and your system will be up to date in almost no time at all.Also, make sure that Timeshift stores its snapshots on a dedicated storage partition on your hard drive or even on anhard drive. That way, your system won't ever run out of disk space because of Timeshift.Proceed as follows:From the menu, launch Timeshift. In the panel of Timeshift: Settings - LocationSelect the dedicated storage partition you wish to use for this.the partition you select needs to be formatted as a Linux partition, so FAT32 or NTFS won't do. A partition formatted as EXT4 is the best option.8. If you're not a user of Asian fonts, you might remove a couple of those. That should free up several hundred MB's of disk space, but more importantly: the font selection box in Libre Office will become much less cluttered.sometimes, removing fonts may have unwanted side effects! Although I haven't experienced those on my machines yet after the removal of the Asian fonts described below, it's something to keep in mind....This is how to remove most Asian fonts:a. Launch a terminal window.b. Copy/paste the following command line into the terminal, in order to avoid typing errors. It's one huge line:Press Enter. Type your password when prompted.Press Enter again.c. Just to make sure, follow it up with this terminal command (use copy/paste to transfer it to the terminal):Press Enter.d. Reboot your machine.Finally: I strongly advise to leave it at that. Don't remove any other fonts, because of the aforementioned risk of negative side effects!8.1. Regrets? If you want to re-install the Asian fonts that you've removed by applying the how-to in item 8, simply replace the word "remove" by "install" in its removal command line. Runagain, reboot and all should be like it was before.9. You probably have installed new kernels from time to time. If so, you may want to clean up a bit, after a while.After a kernel update, the old kernel still shows in the Grub boot menu, under the header. Because you might want to start your machine with the old kernel, if the new kernel doesn't function well....So far, so good. But having more than one redundant kernel is superfluous and a waste of disk space, because each kernel uses up more than 200 MB (headers included). Below I describe various ways how you can remove old kernels and thereby clean up the Grub boot loader menu as well.don't use cleaning applications like Bleachbit or Computer Janitor for this job! They are dangerous and at best superfluous.Now let's get started:9.1. Is the amount of old kernels huge? This is how you can remove all old redundant kernels quickly, in one stroke:a. Launch Update Manager. In the toolbar of Update Manager: View - Linux kernelsThis may take some time. Then a warning window pops up. Ignore it and click "Continue" in order to proceed.b. Press the buttonYou should then get to see a list of all removable old kernels.I strongly recommend not to throw away all of them: leave at least one spare kernel installed. You never know when such a spare kernel might come in handy, for example when your currently active newer kernel suddenly starts misbehaving....9.2. You can also remove a specific redundant kernel. Like this:a. Launch Update Manager. In the toolbar of Update Manager: View - Linux kernelsThis may take some time. Then a warning window pops up. Ignore it and click "Continue" in order to proceed.b. Ignore the button labeled, because that button is meant for mass removal. Just click on the kernel that you want to throw away. Then click on the "Remove" button.I strongly recommend to leave the latest redundant old kernel in your system, just to be on the safe side! It never hurts to have a spare kernel that's known to work well....c. Now reboot your computer.9.3. The easiest and recommended way to prevent an accumulation of old redundant kernels, is to enable the automatic feature for removing obsolete kernels in Update Manager.It's a safe tool to use and smart as well, because it leaves the latest redundant old kernel in your system, just to be on the safe side. It's wise to have one spare kernel that's known to work well...You can enable this automatic feature as follows:Update Manager - panel: Edit - PreferencesTab- section- Remove obsolete kernels and dependencies: switch it on.Do NOT enable! Updates should never be installed automatically, because there's always a risk (however small) that they'll disrupt your work on the computer. That's why you should at all times install them yourself, at a time that suits you, when there's no risk of disruption of your computer jobs.Finished! That's all you ever need to do. Doing more is risky and not advisable.10. The logs ofcan sometimes grow too big. This is how to restrict their size to a sensible minimum:a. Launch a terminal window.b. First you're going to reduce theirsize well below 100 MB, which should be more than enough in almost all circumstances. For that one-time action, copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter. Type your password when prompted.Press Enter again.c. When that one-time job is done, you're going to put acap of seven log files on the logs. Which equals seven boot procedures.For setting the cap, copy/paste the following command line into the terminal, in order to avoid typing errors. It's one big line:Press Enter.You're done!11. Besides taming the logs of, as described in item 10 on this page, you can also reduce some other system logs. Under normal circumstances this won't free up nearly as much disk space as taming thelogs, but it's always fun to restrict the system log files to a sensible minimum....Proceed as follows:a. Launch a terminal window.b. First you're going to deletesystem logs. For that one-time action, copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter. Type your password when prompted.Press Enter again.c. Now you're going to reduce the number of kept logs to 1, for two types of logs, in the settings file. For thelog type, copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter.Then copy/paste this command into the terminal for thelog type:Press Enter.d. Then you're going to set the log rotation forto daily instead of weekly. Log rotation simply means starting afresh; you're going to configure your system to start each day with a new empty log, thus limiting its potential size. Proceed like this: Copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter.e. Now you're going to reduce the number of kept logs to 1, in another settings file named Copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter.f. Then you're going to set the log rotation into daily instead of weekly. Copy/paste the following command line into the terminal, in order to avoid typing errors:Press Enter.g. Finally, reboot your computer.You're done!12. Have you enabled the firewall ufw (which is recommended)? Then you'll probably never look at its logs, so it won't hurt to turn off all logging by the firewall. Especially because it can be rather spammy sometimes. Turning off its log can be done like this:a. Launch a terminal window.b. Copy/paste this blue line into the terminal:Press Enter. Type your password when prompted.Press Enter again.12.1. Do you want to enable logging by the firewall again? Then use the following terminal command to turn firewall logging on again with the default amount of activity (low):All should be then, as it was before.13. Do you have polluted settings in Firefox or Chrome (sometimes caused by rotten, shady or rogue add-ons), and do you wish to start anew with a clean browser? Then proceed like this:a. First make a backup of your current web browser settings (because you never know why you might need them sometime):- Launch a terminal window (this is how to launch a terminal window: *Click*) - Use copy/paste to transfer the following blue command line to the terminal:Press Enter.Press Enter.b. Now export your bookmarks to a backup file:Click the "Library" button (the one with the four bars) - Bookmarks - Show All Bookmarks (down below)Import and Backup - Backup...Save thefile to the location you prefer.Later on, you can import your bookmarks again in a clean Firefox.On the upper right in your browser window, click on the three dots - Bookmarks - Bookmark managerClick on the three white dots - Export bookmarks to HTML file...Later on, you can import them again in your clean Chrome.c. You will also lose all of your stored login passwords for websites! Make sure you know them all.d. Close the web browser you wish to clean.e. Launch a terminal window.f. Copy/paste the following blue command line into the terminal, in order to avoid typing errors:Press Enter.Press Enter.g. Launch your web browser again. It should be clean.h. Import your old bookmarks from the backup you've created. Importing can be done by means of the same feature as the one you've used for exporting.You're done! From now on, avoid all shady add-ons and extensions, and install only those that you really need and trust.Do you want more tips and tweaks? There's a lot more of them on this website!For example: