You're welcome and thanks for the information....much appreciated.Ok, thanks. I don't have Timeshift installed on my machine.
I have a question: if I uninstall/reinstall Ubuntu to factory state, my problems will logically be solved. Because I've been doing a lot of testing, changing, uninstalling and reinstalling third-party services/packages in a lot of different ways, and I think that's what's been causing me all my problems (removing packages that are useful for the system to work properly, for example?). So I'd like some advice on the best way to do it (a clean install), and if there's any software/services I should install/configure for better security (iptables, ufw/firewalld, clamonacc/OnAccessScan, fail2ban, rkhunter/chkrootkit, timeshift...)? Thank you very much for your help.
With all of the testing and so fourth that you made to the system, I'm inclined to say that a fresh installation is wise.
In order to have a successful fresh installation you'll need to prepare ahead of time.
This way there won't be any surprises when the partition manager and installer do their jobs.
Know the architecture of your computer. Is it 32-bit or a 64-bit machine?
Verify your Ubuntu Linux .iso after the download completes.
If the signatures don't match then you haven't loaded up a USB or CD/DVD with a corrupt .iso image.
*Use Etcher or Ventoy to make your USB bootable-
balenaEtcher - Flash OS images to SD cards & USB drives
A cross-platform tool to flash OS images onto SD cards and USB drives safely and easily. Free and open source for makers around the world.
etcher.balena.io
Ventoy
Ventoy is an open source tool to create bootable USB drive for ISO files. With ventoy, you don't need to format the disk again and again, you just need to copy the iso file to the USB drive and boot it.
www.ventoy.net
Once your new Ubuntu installation finishes reboot. At the first fresh boot I recommend doing only one thing first.
*Update the system and reboot again.
**Install Timeshift and go through the set up to take the first snapshot of your freshly installed system.
You might want to tell Timeshift to place the snapshots on an external drive instead of the drive you just performed the fresh install on. Timeshift can take up a lot of room depending on how frequently you have it scheduled to take snapshots.
--Over time you can run into your system complaining that the disk is out of space.--
**UFW is a good security measure to set up. By default is disabled so see the link here:
I used rkhunter in the past and it returned false positives on my systems. Over time rkhunter never found anything that was a trreat. I don't use it any longer. I would personally trust Selinux more than any program for intrusion protection. Selinux is more complex to use so maybe give AppArmor a spin.
Other members may have other ideas:-
Compare two Linux security modules: SELinux vs. AppArmor | TechTarget
Compare SELinux vs. AppArmor Linux kernel security modules. While SELinux gives users more control, AppArmor is well suited for beginners.
www.techtarget.com
Here is a good read on chrootkit if you want to use it:
I don't use fail2ban (for servers) or On Access Scan so perhaps @wizardfromoz and @Condobloke can elaborate on those daemons.
HTH
Alex