Ubuntu – How to stop automatic freshclam execution

clamavprocessservicesupdatesupgrade

I have the latest version of freshclam and clamav installed, and in the past (when I had Ubuntu 14.10) it has only run freshclam automatically a few times a day, but has not been running all the time. Now what I am finding though that if I go to Terminal and execute:

sudo freshclam

That I get:

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

And then the only way to be able to manually run that command is to kill the freshclam process, but this is time wasting, and annoying, so I would like to fully stop freshclam from auto updating, so that I can do manual updates.

So what I tried was to install clamtk, and in the Update Assistant settings I tried to set it so that I would manually install updates, and then I clicked Apply, but this seemed, even after a restart, to have no impact on how freshclam behaved.

So really my question is, how can I get it so that freshclam does not automatically check for updates, or at least for it to do it a few times a day, but not always be there so that I have to kill it to run it? Or is there a way to fix clamtk so that it does it properly (I have got in touch with the developer of clamtk and he is looking into it, but does not know what the issue is)?


OS Information:

Description:    Ubuntu 15.04
Release:    15.04

Package Information:

ClamTk:

clamtk:
  Installed: 5.18-1
  Candidate: 5.18-1
  Version table:
 *** 5.18-1 0
        100 /var/lib/dpkg/status
     5.15-1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ vivid/universe amd64 Packages

ClamAV:

clamav:
  Installed: 0.98.7+dfsg-0ubuntu0.15.04.1
  Candidate: 0.98.7+dfsg-0ubuntu0.15.04.1
  Version table:
 *** 0.98.7+dfsg-0ubuntu0.15.04.1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages
        100 /var/lib/dpkg/status
     0.98.6+dfsg-1ubuntu2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

Best Answer

Related to https://askubuntu.com/a/1204422/231142


That is the freshclam daemon running that is causing that error message. If you check the log, tail -10 /var/log/clamav/freshclam.log you will probably see updates for the freshclam as early as today. As long as you're seeing updates, everything is working fine. I actually don't recommend disabling it as you might forget to update later on.

If you want to change the intervals to the freshclam daemon, type in the following from a terminal window:

sudo dpkg-reconfigure clamav-freshclam

then step through the setup. In the setup, it asks how many times a day for it to update. It defaults to 24 (once per hour). If you want it to update more, set it for 48 (twice per hour). 12 for once every 2 hours.