PDA

View Full Version : [all variants] Clam AV Manual Installation (from Sources)



er_mahavir
May 30th, 2010, 10:46 AM
Introduction:

An open source anti-virus to scan windows partition.

clamav is a command line tool.
clamtk can be used as its frontend.

Need of this post
* Upgrade to clamav independent of distro-based release.
* The clamav package that is present in official repository of Ubuntu 9.10 is outdated.

Clam AV Compilation and Installation
1. Download clamav-0.96.1.tar.gz or latest version if available to your home folder.
2. Open shell and give following commands.


cd ~/
tar -xvf clamav-0.96.1.tar.gz
sudo mkdir /usr/local/built_clamav
sudo chmod 777 /usr/local/built_clamav
cd clamav-0.96.1
./configure --prefix=/usr/local/built_clamav
make
make install

3. As we have installed clamav at a custom location so edit ~/.bashrc and add the following:
Add /usr/local/built_clamav/bin/ in the path

export PATH=/usr/local/built_clamav/bin:$PATH Add /usr/local/built_clamav/share/man in the MANPATH

export MANPATH=/usr/local/built_clamav/share/man:$MANPATHClam AV virus database update
First, let us see the problems that I encountered while updating the virus database.

Run freshclam to update the database. Following error will be encountered:

freshclam
ERROR: Please edit the example config file /usr/local/built_clamav/etc/freshclam.conf
ERROR: Can't open/parse the config file /usr/local/built_clamav/etc/freshclam.conf
Resolving the issue:
Edit /usr/local/built_clamav/etc/freshclam.conf using your favorite editor:

emacs -nw /usr/local/built_clamav/etc/freshclam.confComment/Uncomment & Modify the following lines in the file

# Example
DatabaseDirectory /usr/local/built_clamav/var/lib/clamav
UpdateLogFile /usr/local/built_clamav/var/log/freshclam.log
Exit the editor
Create the required directories


mkdir -p /usr/local/built_clamav/var/log
mkdir -p /usr/local/built_clamav/var/lib
Now, run freshclam to update virus defintions and it should be able to download the virus definitions

freshclamClam AV GUI = clamtk

Note: As clamtk is written using PERL, so there is no need of compilation

1. Download clamtk-4.26.tar.gz to your home folder.
2. Open shell and give following commands.


cd ~/
tar -xvf clamtk-4.26.tar.gz
mv clamtk-4.26 /usr/local/built_clamav/share/
3. As we have installed clamtk at a custom location so edit ~/.bashrc.
Add /usr/local/built_clamav/share/clamtk-4.26/ in the path

export PATH=/usr/local/built_clamav/share/clamtk-4.26/:$PATH3.On running the clamtk gui, following error was shown


clamtk
Can't locate ClamTk/Prefs.pm ...
Resolve by doing following steps:


cd /usr/local/built_clamav/share/clamtk-4.26/
mv lib/ ClamTk/
Now, edit /usr/local/built_clamav/share/clamtk-4.26/clamtk file using your favorite editor

emacs /usr/local/built_clamav/share/clamtk-4.26/clamtkAdd following line

use lib '/usr/local/built_clamav/share/clamtk-4.26/';Finally, add shortcut to desktop:

cp /usr/local/built_clamav/share/clamtk-4.26/clamtk.desktop ~/Desktop/A "Virus Scanner" shortcut will be present on the desktop.

Double-click the launcher to run clamtk. A warning message comes up.

Choose "Mark as trusted" when pop-up comes up.