Aggam Rahamim's Site

Home Contact Random RSS

📅 02-04-2021 👀 368

Why linux users don’t use an antivirus

a few days ago I was talking to my friends about linux, and I said “you don’t need an antivirus on linux”. After saying it I was thinking about it, why is that? why don't we use antiviruses? I mean, exploits exist in any OS, even linux. So what is it?

The basic idea

I figured it’s because how we install software. In windows, you pretty much have to install software from websites (the microsoft store has nothing, come on), which can sometimes be sketchy and might have viruses in them, or will give you an install for the program, but during the install, it will install viruses without you knowing it (happened to me once or twice). On linux, must of the time (will address other times later), you will use your package manager to install software, like pacman -S vlc or apt install vlc, and when you do that, it grabs the package which is basically an archive with the files to be installed, from a list called a repository (repo) and installs it. these repos are maintained by the distro maintainers, as long as you didn’t add any other unofficial repo (which u shouln’t unless it’s from a trusted source), and you should trust your distro maintainers, as you use the OS they made.

The AUR - Repository maintained by the users

In other cases, like on Arch linux, you can also install thing from a repository to which all users can upload software, called the AUR - Arch User Repository. You could argue that users can intentionally put malicious software there, which is true, but because of the nature of the AUR, anyone, including you and the maintainers of the AUR, can view the PKGBUILD of the package - a file that contains instructions on how to build the package to install, so you can see where it grabs the software from and what it does to your computer, so you would know to avoid it and perhaps report it to a trusted user. you might also argue that no one is gonna look at that, but to install software from the AUR you can manually download the files with git and install, but then you might as well look at it. but what most users do, is use an AUR helper. An AUR helper is a piece of software used to install and update software from the AUR more easily. My AUR helper of choice, `paru`, has an option to show you the PKGBUILD before installation and ask for permission to install, so I know not install bad packages.

But what if you have to install from a website?

That rarely happens, but it does, so what do you do then? Well, just download software from sources you trust. If you install DaVinci Resolve, install it using the file from their website. If you trust their program, you can trust their installer.