Oct
18th

Installing Clamscan on CentOS 5

Filed under The Server Room | Posted by Gary

I spent a bit of time searching for an answer to this and found it in a couple of places. Here are the required step to get clamscan installed on Centos 5.

1. Download the rpmforge package
wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

2. import the rpmforge GPG key
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

3. Check that you have a valid RPM file
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

4. Install rpmforge
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

5.  Install yum priorities
yum install yum-priorities

Yum-priorities allows you to add a priority parameter to each of the repositories listed in /etc/yum.repos.d. You need to do this to ensure that the base repositories always take precedence over the rpmforge repository.

6. Edit each of the .repo files in /etc/yum.repos.d adding a priority line to each repository like this:

[base]
name=CentOS-$releasever – Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

Give all of the repositories a priority of 1 except the repositories in the rpmforge.repo file – they should have a priority of 2

7. Install clamav (alter the filename if you have a 64 bit server)
yum install clamav.i386

8. Install the clamd daemon (you need this for freshclam which updates the virus database
yum install clamav.i386

9. Configure the clamd daemon to start at reboot
chkconfig clamd on

10. Start the clamd daemon
service clamd start

Run freshclam to update the database

You must be logged in to post a comment.