sudo dnf install clamav clamav-freshclam clamdsudo setsebool -P antivirus_can_scan_system 1Edit the daemon config:
sudo nano /etc/clamd.d/scan.confMake sure these lines are uncommented and tuned:
LocalSocket /run/clamd.scan/clamd.sock
TCPSocket 3310
User clamscan
MaxThreads 8 # set this to number of cores or half if you want to keep system responsive
FollowFileSymlinks yes
FollowDirectorySymlinks yes
ScanArchive yes
MaxScanSize 2G # fix for “decompress file size exceeds limits”
MaxFileSize 2G # fix for “decompress file size exceeds limits”Save and exit.
sudo systemctl enable --now [email protected]Check it’s active:
sudo systemctl status [email protected]sudo freshclam-
Scan only your home directory (replace
yourusername):sudo clamdscan --multiscan --fdpass -i --remove \ --exclude-dir="/home/yourusername/.cache" \ --exclude-dir="/home/yourusername/.local/share/flatpak" \ /home/yourusername
-
Scan the entire system root (excluding noisy system dirs):
sudo clamdscan --multiscan --fdpass -i --remove \ --exclude-dir=/proc --exclude-dir=/sys --exclude-dir=/dev \ --exclude-dir=/run --exclude-dir=/var/lib/flatpak \ /
Run this in another terminal while scanning:
htop -t | grep clamdYou should see multiple clamd worker threads consuming CPU across cores.
-
--multiscanruns parallel threads managed by theclamddaemon. -
--fdpassallows file descriptor passing undersudo, avoiding permission issues. -
MaxScanSizeandMaxFileSizeoptions handle large compressed files to silence:LibClamAV Warning: cli_scanxz: decompress file size exceeds limits -
Adjust
MaxThreadsto match your CPU core count (nprocshows how many you have). -
--removeautomatically deletes infected files — switch to--move=/quarantineif you want a safer review workflow.