as you may notice, I am new to Ubuntu (actually, Lubuntu). I have a question regarding security when installing software. When using Windows before, what most people do is to download a .exe, scan it with AV or similar, and if it was good, install. Now, in Ubuntu distros you just go "apt install XXX" or "snap intall XXX" or whatever. The question is: why and how is this safe? Is everything installed in that way secure? Everything that comes from apt or snap or others is safe and should only worry about 3rd party repos?
Thank you very in advance for making this clear!