Updating the package version of ClamAV on Ubuntu.

The freshest clams

Anti-virus programs are great… provided you keep them up to date! Sometimes keeping them up to date can be tricky if they are prepackaged from a repository – you have to wait until someone packages the updated version. This isn’t ideal, as I discovered one day after checking my ClamAV freshclam.log

I noticed that on reboot I would get the familiar message at startup that the ClamAV engine was out of date, but I thought to myself: “No problem, won’t be long before a new version is uploaded to the repository, and in the mean time, at least I’m getting the latest definitions.” – WRONG!

A quick check of my freshclam.log (the log file written to each time ClamAv updates itself) revealed this:

sudo tail -f /var/log/clamav/freshclam.log

-> ClamAV update process started at Sun Feb 12 06:44:40 2012
-> WARNING: Your ClamAV installation is OUTDATED!
-> WARNING: Local version: 0.96.5 Recommended version: 0.97.3
-> DON'T PANIC! Read http://www.clamav.net/support/faq
-> main.cld is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
-> WARNING: getpatch: Can't download daily-14129.cdiff from db.local.clamav.net
-> WARNING: getpatch: Can't download daily-14129.cdiff from db.local.clamav.net
-> WARNING: getpatch: Can't download daily-14129.cdiff from db.local.clamav.net
-> WARNING: getpatch: Can't download daily-14129.cdiff from db.local.clamav.net
-> WARNING: getpatch: Can't download daily-14129.cdiff from db.local.clamav.net
-> WARNING: Incremental update failed, trying to download daily.cvd
-> WARNING: Can't download daily.cvd from db.local.clamav.net
-> Trying again in 5 secs...

The work-around

There is a way to get the latest versions via the PPA for Clamav Update Team – By adding their repository we can get a newer version of ClamAV for Ubuntu.

WARNING!

This “untrusted” PPA uses unsupported packages – Use at your own risk!! (sure, but try finding the updates any place else for Ubuntu…)

First of all, visit the ClamAV website to determine the latest version of the ClamAV engine.

Next visit the PPA for Clamav Update Team and check the section titled “Overview of Published Packages“, and filter by your version of Ubuntu.

Check the section of the PPA titled “Adding this PPA to your system“, and expand the section “Technical details about this PPA” – it’s important to note the value detailed under “Fingerprint

To start installing and using software from a Personal Package Archive (PPA), you first need to tell Ubuntu where to find it. Add the repository to your apt sources file…

sudo vi /etc/apt/sources.list

deb http://ppa.launchpad.net/ubuntu-clamav/ppa/ubuntu ubuntu_version main
deb-src http://ppa.launchpad.net/ubuntu-clamav/ppa/ubuntu ubuntu_version main

Where ubuntu_version would be lucid, maverick, natty, oneiric, etc…

This repository is signed by the PPA’s public key, which you can install so that you don’t get asked for confirmation all the time.

sudo apt-key advanced --keyserver keyserver.ubuntu.com --recv-keys F80220D0E695A455E651AC4D8AB767895ADC2037

Note: That command is all on one line…

Now update the repository listings and install the updates.

sudo aptitude update
sudo aptitude safe-upgrade

If you’re worried you might pick up some “unproven” source next time you’re doing your updates, simply comment out the two lines above after you’ve got the newer version of ClamAV… Yay!