Install ClamAV Antivirus in Ubuntu

ClamAV is an open-source Antivirus tool available for Linux distributions. It integrates Mail servers to scan attachments received. In addition to scanning mail attachments, it provides protection to corporate networks. Other functions also include web scanning. In this article, we would discuss how to install ClamAV Antivirus in Ubuntu.

We are provided with a command line interface, with the installation of ClamAV package in repositories. For those who are not comfortable with command line interface, may opt to install Clamtk package to get the Graphical User Interface (GUI). ClamAV utilizes Milter interface for Sendmail and has built-in support for various file formats.

Install ClamAV in Ubuntu 19.04

Open Ubuntu terminal using the shortcut key –

Ctrl+Alt+T

You need to have superuser privileges to make any changes, otherwise contact your System Administrator for assistance.

Type the following command to update and install repositories and ClamAV Antivirus respectively.

sudo apt update
sudo apt install clamav clamav-daemon

Once, the packages are successfully installed, the Antivirus will update its relevant packages in the background by itself.

To scan directories we need to type the following command in terminal:

clamscan -r -i --bell /home/

where,

-r, to scan sub directories recursively,

-i, to print infected files,

–bell, a bell sound if it detects a virus,

/home/, directory we intend to scan – you can use directories of your choice

This command only scan directories and provides us with the list of infected files. But, what if we plan to move infected files to some other directory. It could be a better choice as removing an infected file may break our system. Hence, we tread with caution and move the infected file to some other directory. We need to type the following command in terminal –

clamscan -i -r --move="/home/<home-directory>/Downloads/" /home

The above command will scan the directory /home/ and if infected files are detected then, it will move those files to the directory /home/<home-directory>/Downloads/.

Type clamscan -h for more options.

Install clamtk in Ubuntu

Some users are not comfortable when using a command line interface. They can install a graphical version through package clamtk. Type the following command –

sudo apt install clamtk

Once the package clamtk is successfully installed you can use the Graphical User Interface for further operations.

You can also install packages through Synaptic Package Manager or Software Centre. All you have to do is search for the relevant packages mentioned above and perform the install operation. It is worth mentioning here that, you can install the packages through command line interface or you could take the help of a package manager – the outcome will be the same in both the cases.

In conclusion, we have discussed how to install ClamAV Antivirus in Ubuntu distribution.