This guide provides step-by-step instructions on how to install ClamAV, an open-source antivirus software, on a Linux system. We'll cover the installation on Ubuntu/Debian and CentOS/RHEL systems.
Before installing new software, it's a good idea to update your package list. Open your terminal and run:
sudo apt update
Install ClamAV and its utilities using apt:
sudo apt install clamav clamav-daemon
The clamav-daemon package allows ClamAV to run as a background service.
After installation, you need to start the ClamAV service and enable it to run at boot:
sudo systemctl start clamav-daemon
sudo systemctl enable clamav-daemon
The effectiveness of ClamAV depends on keeping its virus database up-to-date:
sudo freshclam
This command updates ClamAV’s database. It's also configured to run automatically by default.
To perform a manual scan, use:
clamscan [options] [file/directory]
For example, to scan the entire system, run:
sudo clamscan --infected --recursive --exclude-dir="^/sys" /
ClamAV is available in the Extra Packages for Enterprise Linux (EPEL) repository. If it's not already enabled, enable EPEL:
sudo yum install epel-release
Now, install ClamAV:
sudo yum install clamav
Similar to Ubuntu/Debian, start and enable the service:
sudo systemctl start clamd@scan
sudo systemctl enable clamd@scan
Update the virus definitions:
sudo freshclam
You can start a scan using:
sudo clamscan --infected --recursive --exclude-dir="^/sys" /
After following these steps, ClamAV should be successfully installed and configured on your Linux system. Regularly updating the virus database and performing system scans is crucial to maintaining system security.
ClamAV official documentation: ClamAV Official Documentation