I think most have forgotton, every operating system has viruses!
It is just as easy to install a virus on linux as it is Windows.
It is just the fact that we can detect it on Windows and it is more widely used.
Uh, no.
The difference has to do with package management. On Linux, the vast majority of software is installed through apt or yum using select package repositories.
The package manager checks the crytographic signature of the package before it installs it.
For example -
[alice@localhost ~]$ rpm -qi bitcoin
Name : bitcoin
Version : 0.11.2
Release : 2.el7.awel.libre
Architecture: x86_64
Install Date: Tue 12 Jan 2016 06:59:45 PM PST
Group : Applications/System
Size : 10125882
License : MIT
Signature : RSA/SHA1, Tue 12 Jan 2016 06:51:56 PM PST, Key ID ad3b591d147abf59
Source RPM : bitcoin-0.11.2-2.el7.awel.libre.src.rpm
Build Date : Tue 12 Jan 2016 06:44:03 PM PST
Build Host : localhost
Relocations : (not relocatable)
URL : http://bitcoin.org/
Summary : Peer-to-peer digital currency
Description :
Bitcoin is an experimental new digital currency that enables instant
payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer
technology to operate with no central authority: managing transactions
and issuing money are carried out collectively by the network.
Bitcoin is also the name of the open source software which enables the
use of this currency.
This package provides Bitcoin-QT, a user-friendly wallet manager for
personal use.
[alice@localhost ~]$
On Windows, software is typically installed by downloading it from who knows where without any kind of signature verification process involved. That results in trojans and malware.
Also, on Linux you are far less likely to find Adobe Flash installed. Adobe Flash is a huge vector for malware on Windows, but even when Adobe was producing Flash for Linux, Linux users just never really embraced it. We didn't want it.
Also, Linux has mechanisms for verifying the integrity of installed packages. With packages installed from who knows where on Windows systems, that really just isn't possible.
So yes - there can be viruses for Linux and there frequently are worms that impact Linux but the reality is the advanced package management we have had for over 15 years now just makes it a lot easier for us to keep the entire system up to date, verify packages are properly signed by a repository we trust, and verify the integrity of a package.
That makes Linux a lot easier to keep safe from the type of malware that plagues Windows.