
Viruses, Trojans, and other malware threats can infect any operating system, so in today’s world, every system, including Ubuntu Linux, requires some form of antivirus protection.
ClamAV is the best antivirus for Ubuntu Server/Desktop. It is a Free Open Source antivirus software solution that functions similarly to Windows Antivirus.
Enter the following command to install ClamAV on your Ubuntu machine:
apt install clamav
Users of Ubuntu Desktop can also install ClamTk, a graphical front end.
apt install clamtk
Run the following command to see what ClamAV version you have:
clamscan --version
Update Virus database/definitions
We should run the freshclam command after the installation is complete to update the virus signature database.
First, the freshclam service must be halted:
systemctl stop clamav-freshclam.service
Then, to update the database, run the following command:
sudo freshclam
Restart the freshclam after that:
systemctl start clamav-freshclam.service
The signature database plays a big role in ClamAV’s ability to detect new viruses. As a result, it is critical that we keep it current. The database, on the other hand, does not need to be manually updated. In Ubuntu, the Freshclam service runs in the background and checks for updates on a daily basis (12 times per day by default).
Can’t download daily.cvd due to timeout
Increase the ConnectTimeout and ReceiveTimeout values in the /etc/clamav/freshclam.conf file if you get these errors when updating the virus definition. There is no timeout if the value is zero.
Scanning with ClamAV
ClamAV is a virus scanner that can detect viruses, Trojans, and other malware. With the clamscan command, you can check for viruses in files.
sudo clamscan -ir /home/
Using the -r option, we scan the /home directory recursively in this example. The -i option is used to only output infected files rather than the names of all files scanned. When the scan is finished, it displays the following summary:

The ClamTk graphical user interface is available for Ubuntu Desktop users, but the command line (clamscan command) is much faster.
