How do I manually import the clamav virus definition file?

Solution 1:

You could probably do a script like so to download the updated file then copy it over to the proper location for an update manually.

Script contents

#!/bin/bash
wget http://database.clamav.net/main.cvd
sudo cp main.cvd /var/lib/clamav/
sudo chown clamav:clamav /var/lib/clamav/main.cvd
sudo chmod 644 /var/lib/clamav/main.cvd

Solution 2:

If clamav have been installed from official repositories, the database folder is /var/lib/clamav
This folder contains some files, not only main.cvd
3 files are part of the database:
https://database.clamav.net/main.cvd
https://database.clamav.net/daily.cvd
https://database.clamav.net/bytecode.cvd

Once a machine1 have his ClamAV updated with freshclam (or so), another machine2 can copy the directory content to his local /var/lib/clamav folder.

To check if manual update of machine2 has worked, you can compare the outputs of clamscan --version on machine1 and machine2. And/or compare md5sum of .cvd files.

This could be pretty easy to script with some backup and rollback actions in case of failure.
Of course, the embedded Private Local Mirror feature seems more elegant but require a local webserver.