8

I was updating the clamav antivirus defenitons with the sudo freshclam command and the output was:

ERROR: /var/log/clamav/freshclam.log is locked by another process
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

3 Answers3

12

This is likely to be because the update is currently being run automatically, or you are running it somewhere else (you would know about this). You can change how often it is run automatically, and also stop it being run automatically by running the following:

sudo dpkg-reconfigure clamav-freshclam

After completing the setup you will be able to run sudo freshclam without error (unless you set it to cron and you happen to execute the command at the time it automatically checks).

6

I suppose that you cannot update clamav database due to it being locked by running daemon. Presumably Ubuntu proceeds with an automatic update.

To update virus database manually, you have to stop daemon by typing in CLI:

sudo /etc/init.d/clamav-freshclam stop

Now you can update virus signatures:

sudo freshclam -v

Finally, restart daemon with

sudo /etc/init.d/clamav-freshclam start
-2

Another thing to do is to edit the /var/log/clamav/freshclam. conf file and change the 1 to 0. This is the only datavthat you will see in the file, if not LEAVE IT ALONE!!!!!! and wait.

Do this ONLY IF THE OTHER SOLUTIONS DO NOT WORK! While this is a drastic step, what it does is to tell Freshclam that it hasn't run yet.

REMEMBER THIS IS ONLY THE FINAL SOLUTION if the other suggestions do not work.