Linux Mint

How to Install ClamAV on Linux Mint 21

Clamav is a command-line tool that scans files and directories for viruses, Trojan horses, and other malicious software. ClamAV is also capable of scanning emails and other types of files, making it a versatile and powerful tool for protecting your system from malware. Since this anti-virus application is command line but there is a GUI application for it as well so read this guide to know how to get it on Linux Mint 21.

Installing ClamAV CLI on Linux Mint 21

ClamAV is based on a multi-threaded scanning engine that can quickly scan large files and directories so to get it on Linux Mint just use:

$ sudo apt install clamav

Once the antivirus is installed check its version to see if it is installed correctly and for that purpose execute:

$ clamscan --version

Scanning Files and Directories Using ClamAV CLI

ClamAV uses a combination of signature-based detection and heuristic analysis to identify and remove malware and therefore it is preferred by many Linux users so to scan any directory using ClamAV CLI below is the syntax that should be followed:

$ clamscan ~/<directory-name-or-directory-path>

For further illustration I have scanned my Downloads directory of Linux Mint by using the above-mentioned syntax:

$ clamscan ~/Downloads


If you want to just see the infected files only then just use the –infected command by using the above-mentioned syntax:

$ clamscan --infected ~/Downloads

If you want to remove the infected files automatically then just use the –remove command by using the above-mentioned syntax, but remember that if the antivirus feels any suspicious file, it will also remove it so be careful before using this command:

$ clamscan --remove ~/Downloads

Further if you want to scan any file for viruses then just follow the given below syntax:

$ clamscan ~/<file-path>

For further illustration I have scanned a zip in the Downloads directory of Linux Mint by using the above-mentioned syntax:

$ clamscan ~/Downloads/clamav-1.0.0.win.x64.zip.sig

Now to remove this application from Linux Mint 21 then execute the below-mentioned command in case you installed it through apt:

$ sudo apt remove clamav -y

Installing ClamAV GUI on Linux Mint 21

One of the key advantages of ClamAV is its open-source nature, which allows users to inspect the source code and make modifications as needed so if you are more comfortable in using the GUI of Linux Mint then install its GUI version by executing:

$ sudo apt install clamtk -y

Text Description automatically generated

Next the run the application through Linux Mint terminal:

To scan any file or directory just click on Scan a directory and from the pop-up select the respective directory or file and afterwards click on OK:

Once the file or directory is scanned the complete statistics like number of files scanned and number of possible threats will be displayed; next click on the close button once the scan is completed:

Now to remove this application from Linux Mint if you are no longer to use it then execute the below command in case you installed it through apt:

$ sudo apt remove clamtk -y

Conclusion

ClamAV is a powerful and flexible antivirus software that is well-suited for use on mail and web servers, as well as for individual computers. This guide gives the complete guide on how to install both the CLI and GUI version of ClamAV on Linux Mint and how to scan files or directories through it.

About the author

Aaliyan Javaid

I am an electrical engineer and a technical blogger. My keen interest in embedded systems has led me to write and share my knowledge about them.