New ClamAV / clamscan / freshclam on old Ubuntu (Feisty or the like)

A typical situation – you get to audit a server setup which hasn’t seen a apt-get update / apt-get upgrade or even apt-get dist-upgrade since Netbooks were a pipedream.

“Please don’t change anything, we only want a virus scanner, but the update cache is busted,” they say. That you see a whole bunch of 404‘s in the apt (or aptitude) feedback is normal — there is no active repo for this flavour anymore! Long-gone!

So – what to do? As you would, you compile from source. Ha — one gotcha — zlib‘s probably not installed (compression library, as you know).

So – quick move to virus scanning happiness (on the latest version):

$> wget http://www.zlib.net/zlib-1.2.3.tar.gz (or from a mirror – visit www.zlib.net for the full selection)
$> tar -zxvf zlib-1.2.3.tar.gz
$> cd zlib-1.2.3
$> make clean
$> ./configure -s
$> make
$> make install

and now there’s only one step left:

Get the latest version of clamav (0.95.2 at the time of writing):

$> wget https://launchpad.net/ubuntu/dapper/+source/clamav/0.95.2+dfsg-4ubuntu1.1~dapper1/+files/clamav_0.95.2+dfsg.orig.tar.gz (I used dapper or similar)
$> tar -zxvf clamav_0.95.2+dfsg.orig.tar.gz
$> cd clamav_0.95.2+dfsg
$> make clean
$> ./configure -s
$> make
$> make install

One more freshclam and you’re ready to clamscan -r / -i your heart out! 🙂

But you knew that already!