18

After installation of CLAMAV and try to scan I see this error. How do I solve this?

$ clamscan scan
LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav
ERROR: Can't open file or directory

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 0.98.7
Scanned directories: 0
Scanned files: 0
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 0.003 sec (0 m 0 s)
2
  • 4
    Two thoughts for start - have you run freshclam to update clamav databases? Also - make sure that freshclam is updating databases in the same directory, where clamav is looking for them (/var/lib/clamav) - check configs for that.
    – Jacek
    Jan 14, 2016 at 9:18
  • On Debian 10 this appears right after the installation, but the database is being downloaded in the background (freshclam will tell you that the db is locked). Just wait for it to update. May 4, 2020 at 3:14

8 Answers 8

18

Steps 1-3 below include commands run in a terminal. Please read carefully so that you understand what you are doing.

  1. Remove potentially bad AV installations:

    sudo apt-get remove clamav 
    sudo apt-get remove clamtk 
    sudo apt-get remove freshclam
    sudo apt-get clean
    sudo apt-get autoremove
    
  2. Reinstall AV:

    sudo apt-get install clamav        #Terminal Version
    sudo apt-get install clamtk         #GUI version
    
  3. Update AV Database:

    sudo freshclam               #takes ~30 minutes to download definitions
    
  4. Configure AV & Scan:
    This example uses clamtk only

    clamtk                      #Opens GUI
    

    toggle all options under Settings tab:

    Network

    • toggle proxy and type http://127.0.0.1
    • toggle / reselect **No Proxy **(to gray out what you entered above)

    Update Assistant

    • toggle manual update option and click apply and back
    • toggle automatic update option and click apply and back

    You should now see updated definition count

    Scan a Directory

    • select directory you want scanned. For system scan I toggled the entire system (not just /root or /usr)
    • Click scan and a progress box will appear.

Final Note: typing the phrase --help (without quotations) following command gives some hints. With APT commands you can pass the option -y to say yes to installing all dependencies for the requested package.

This is what I had to do to get clam working, perhaps a glitch for both clamtk and clamav (problem with both). Hope this helps someone else!!!

1
  • in my case I should kill freshclam before step 3, by: sudo pkill -15 -x freshclam Jul 3, 2017 at 12:11
6

The error message tells the tale: LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav and Known viruses: 0

You need

clamav-freshclam - anti-virus utility for Unix - virus database update utility

Also ensure that user running the scan has read access to /var/lib/clamav.

3
cuongpv@anonymouse /home> clamscan --infected --remove --recursive /home
LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav
ERROR: Can't open file or directory

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 0.100.2
Scanned directories: 0
Scanned files: 0
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 0.003 sec (0 m 0 s)

No supported database files found in /var/lib/clamav it mean the database still not avaible to use. Almost of this case is you have just installed clamav. So you need to wait util the database update completed.

You can check with: ps aux | grep clam The result should be

clamav   29675  3.5  0.3 154276 27632 ?        Ss   11:36   0:08 /usr/bin/freshclam -d --foreground=true

Waiting for util the database update complete.

Hope useful for you.

2

Install clamdscan by running:

sudo apt-get install clamdscan
2

There is a time limit for downloading database, in my version it was 30 seconds. Initial file to download is ~60MB.

And now, most peculiar thing: if your connection is slow and you don't get this file within 30s, connection is dropped and it start download it again, from the beginning!

And will continue to do so over and over until it downloads this file in this time window.

To make sure if it is the case, run (kill it before if it's running):

sudo freshclam -v # verbose mode

Solution: Increase ConnectTimeout and ReceiveTimeout in:

sudo gedit /etc/clamav/freshclam.conf

source: https://forum.directadmin.com/threads/how-to-pass-60-sec-time-limit.60045/

1

I had to manually create and set the directory /var/lib/clamav to 777, then run freshclam. This downloaded all the signatures and updated clamav, and all seems well now.

1

After a new installation usually the clamav database and signatures keep downloading without informing the users and without any notifications and users have to wait till all the signatures get updated. That's the real problem.

Checked for the update by using command $ sudo freshclam when the error messages are like below:

ERROR: /var/log/clamav/freshclam.log is locked by another process

ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

Once database get updated Try at first only

$ clamscan

by default it will check home directory.

then use however you like to, like used earlier command...

$ clamscan --infected --remove --recursive /home

-1

me too, on two computers clam runs without any hassle or problems. one pc causes always problems with ... updates,.. yes, why is it always the problem with updating.!

so i manually have set the virus def database to /home/{my userlogin}/.clamtk/db/

I have set it in my home folder, because it seemed to cause problems in other locations .. thus. everytime i need to update it (once a week) i delete everything in that folder, then i run within that folder;

freshclam --show-progress

in a terminal to get the updates. otherwise it will not update , clamtk does not work, no updates are possible to download from there. BUT not within clamtk, but there it DOES show how many virri defs i just downloaded with

freshclam --show-progress

further CLAMTK does run with the virusscans, and shows progress, and detects malware..

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .