A big question usually asked by those who just have switched to Linux “Why Linux doesn’t need antivirus?”. No wonder they ask this sort of question. Assuming that they (new Linux users) previously Windows users, they used to deal with antivirus programs to combat any type of virus. You know, Windows is known as an operating system that has no good reputation in terms of virus-free.
Saying that Linux is completely free from virus would be a big lie. However, compared to Windows, the comparison is probably 1:100 or even 1000. Or even more. I am not joking. I have been a Linux user for over 10 years and never deal with virus, at all. Until today, I never installed any antivirus program in my computer since the first time I switched to Linux.
But as I said, it doesn’t mean that Linux is completely safe from Virus threats. Android is also Linux-based and the number of existing malware is massive enough. Some Linux-based servers also use antivirus programs to give extra protection. Antivirus software isn’t entirely useless on Linux.
But in the desktop environment (laptop or PC), you seems really need to think twice before installing an antivirus program. There are at least two technical reasons why you don’t need to install antivirus program on Linux desktop.
Most viruses come from internet. They can also come from storage mediums, USB flash drive in particular. You really need to extra careful when plugging in your USB flash drive into another laptop/PC, especially public PC. Public PC is the virus nest.
The way a virus works is actually easy enough to learn. It works by installing/running itself on your computer. As long as your operating system has a good user levels, no virus will be able to run itself. An operating system with a good user levels usually only allows user with the highest level (superuser) to run/install new programs. Typically, you will be asked to enter a superuser password to login as a superuser.
Linux is an operating system with a very good user levels. Not all users have the privilege to access system-related files. Only superuser (root), who has the privilege to access all files in the system. Without being a root, you won’t be able to run/install new programs on Linux. That is why virus programs can’t run itself on Linux.
Windows has actually tried to fix this problem by applying UAC (User Account Control) since Windows Vista. However, there are still some holes need to fix. If you run a new program that has a potential to harm your computer, Windows will only display a dialog with a pair of Yes and No button. If you press the Yes button then the program will be running. You won’t even be asked to enter any password!
Installation method of new applications
Another big hole on Windows that often made use of by virus creators is the installation method. Most Windows users still rely on binary files (with the extension of .EXE) to install new applications. There are so many free applications for Windows available on the internet. Sadly, not all free applications are safe enough to install. Some may contain spyware, ransomware and other type of malware.
Linux has a different concept in providing applications. All Linux distributions come with package managers as well as software repository. Package manager is a tool to install new applications on Linux. In addition, a package manager can also be used to update applications as well as removing them. Some examples of package manager are Synaptic, APT, Ubuntu Software Center and so on. Once again, not all users have a privilege to run a package manager. They will be asked to enter the root password to run it.
If you are installing a new application on Linux using a certain package manager, the package manager you are using will be downloading the necessary files from software repository. Software repository (or often called as “repo” for short) is a storage location from which software packages may be retrieved and installed. A repo contains trusted software that has been vetted by your Linux distribution.
Microsoft has actually offered the similar concept in the form of Microsoft Store. However, not all software vendors are willing to upload their products to it. Besides, it’s not easy to change the user habit.
Despite you don’t need to install antivirus on Linux, it doesn’t mean that you need to do nothing to keep your Linux system safe. In order to keep your Linux system safe, be sure to regularly update the installed software, especially the ones you use most frequent. The newest version of software commonly come with bug fixes, other than new features.