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
clamd: error while loading shared libraries: libclamav.so.6: cannot open shared object file: No such file or directory”
Solution:
Run ldconfig:
#ldconfig
Now,
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:
#sudofreshclam -d
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.
/usr/local/etc/clamd.conf:
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
/usr/local/etc/freshclam.conf:
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.
He is a full stack developer, whose favorite languages are currently Python and Vue.js. He is also fluent in Javascript, Flutter/Dart, Perl, PHP, SQL, C and bash shell scripting. He loves Linux, and can often be found tinkering with linux kernel code, and source code for GNU applications. He used to be an active developer on XDA forums, and his tinkered ROMS used to be very popular in the early 2000s.
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.