Download the latest production clamav:
wget http://downloads.sourceforge.net/clamav/clamav-0.98.3.tar.gz tar xf clamav-0.98.3.tar.gz cd clamav-0.98.3 apt-get install libxml2 libxml2-dev libbz2-dev libzip2 libzip-dev ./configure make && make install
If you get the error:
clamd: error while loading shared libraries: libclamav.so.6: cannot open shared object file: No such file or directory”
cp ./etc/clamd.conf.sample /usr/local/etc/clamd.conf cp ./etc/freshclam.conf.sample /usr/local/etc/freshclam.conf emacs /usr/local/etc/clamd.conf emacs /usr/local/etc/freshclam.conf
Create user and group for clamav, and then create log file and clamav directory, setting appropriate permissions:
groupadd clamav useradd -g clamav -s /bin/false -c "Clam Antivirus" clamav touch /var/log/freshclam.log mkdir /var/lib/clamav touch /var/run/freshclam.pid chown clamav.clamav /var/log/freshclam.log chown clamav.clamav /var/lib/clamav chown clamav.clamav /var/run/freshclam.pid
Now update the database by running freshclam as daemon:
If that doesnt work:
#sudo freshclam -v
Read the documentation at http://www.clamav.net/doc/latest.bak/clamdoc.pdf
Comment out the line “Example” from both example conf files.
LogTime PidFile /var/run/clamav/clamd.pid TemporaryDirectory /var/tmp DatabaseDirectory /var/clamav LocalSocket /var/run/clamav/clamd.sock FixStaleSocket MaxConnectionQueueLength 30 ReadTimeout 180 SelfCheck 3600 User amavis AllowSupplementaryGroups ScanPE DetectBrokenExecutables ScanOLE2 ScanMail ScanHTML ScanArchive ArchiveMaxFileSize 10M ArchiveMaxRecursion 5 ArchiveMaxFiles 1000 ArchiveMaxCompressionRatio 300 ArchiveBlockEncrypted ArchiveBlockMax
DatabaseDirectory /var/lib/clamav UpdateLogFile /var/log/freshclam.log LogFileMaxSize 2M LogTime yes LogRotate yes PidFile /var/run/freshclam.pid DatabaseMirror database.clamav.net ScriptedUpdates yes Checks 24 ConnectTimeout 60 ReceiveTimeout 60 Bytecode yes
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.