ClamAV scan entire filesystem

I installed ClamAV and I am trying to run clamscan from the commandline to scan the entire filesystem (/) but it doesn’t seem to be working:

wiking@walhalla:~$ clamscan /
LibClamAV Error: cl_load(): No such file or directory: /usr/local/share/clamav
ERROR: Can't get file status

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 1.4.1
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.002 sec (0 m 0 s)
Start Date: 2024:11:21 15:28:17
End Date:   2024:11:21 15:28:17

sudo clamscan -r /

See also: Use clamdscan on workstation F38 - #3 by vgaetera

1 Like
wiking@walhalla:~$ sudo clamscan -r /
Place your right index finger on the fingerprint reader
LibClamAV Error: cl_load(): No such file or directory: /usr/local/share/clamav
ERROR: Can't get file status

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 1.4.1
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.004 sec (0 m 0 s)
Start Date: 2024:11:22 20:54:55
End Date:   2024:11:22 20:54:55

I probably need these steps, then?

sudo dnf -y install clamav clamd
sudo sed -i -e "/^#*LocalSocket\s/s/^#//" /etc/clamd.d/scan.conf
sudo freshclam
sudo systemctl --now enable clamav-freshclam.service clamd@scan.service
sudo semanage boolean -m -1 antivirus_can_scan_system
wget -O /tmp/eicar.txt \
"https://www.eicar.org/download/eicar-com-2/?wpdmdl=8842"
sudo -u clamscan clamdscan /tmp/eicar.txt

That looks weird, you should install it from the repo as linked above.

Hi Wiking,

The error suggests that you installed clamav from source (form clamav.net) as /usr/local is the typical default location of some of clamav’s files. Usually, if you install from the default repos, clamav is setup to follow the distribution’s conventions. You might try removing/uninstalling the clamav from source and then reinstalling from the repos via DNF.

1 Like