You are here: Home / Debian GNU/Linux / System / Security / Install the ClamAV anti-virus on Debian

Install the ClamAV anti-virus on Debian

by Pierre-Yves Landuré last modified Apr 25, 2013 07:08

ClamAV is a free software anti-virus. Its scanning engine is very efficient. It is particularly suited to e-mail servers protection, and regular checks of server's files. This howto helps you install the latest version of ClamAV on Debian.

This howto is tested on:

  • Debian 6.0 Squeeze
  • Debian 7.0 Wheezy

Prerequisites

This howto recommends:

Installation

Install the anti-virus software :

command apt-get install clamav clamav-freshclam

Install the unofficial signatures if available :

if [ -n "$(command apt-cache pkgnames clamav-unofficial-sigs)" ]; then
command apt-get install clamav-unofficial-sigs
fi

Update the signatures database. This process can take several minutes :

command freshclam

Note : If needed, setup a weekly check of the system (triggers heavy ressources usage) :

command echo "# Weekly antivirus scan.
# m h dom mon dow user command
34 1 * * 7 root test -x /usr/bin/clamscan && /usr/bin/clamscan --infected --recursive / 2>/dev/null" \
> "/etc/cron.d/clamscan-weekly"

The result of this check is sent to root e-mail account.

Thanks

  • Thanks to ClamAV developers.