1080*80 ad

How to Install ClamAV on Rocky Linux 8

Protecting your server environment is paramount, and installing reliable antivirus software like ClamAV provides a crucial layer of defense against malware threats. This guide details the straightforward process for setting up ClamAV on your Rocky Linux 8 system, ensuring you have a robust scanning utility ready to go.

The first step involves enabling the Extra Packages for Enterprise Linux (EPEL) repository, which is essential for accessing the ClamAV packages on Rocky Linux. You can add this repository using the following command:

sudo dnf install epel-release -y

Once the EPEL repository is enabled, you can proceed with the installation of the ClamAV packages. This includes the core scanning engine and the update utility. Execute the command below to install them:

sudo dnf install clamav clamav-update -y

After installation, it is critical to update the virus definitions to ensure ClamAV can detect the latest threats. The freshclam utility handles this task. Run the update manually for the first time:

sudo freshclam

For automatic updates, the freshclam service is typically included with the clamav-update package and configured to run periodically.

ClamAV primarily operates through a daemon called clamd, which loads the virus definitions into memory for faster scanning. You need to ensure this service is running. First, enable the service to start automatically at boot, and then start it immediately:

sudo systemctl enable clamd@scan –now

Note that the service name might be slightly different depending on the specific installation, but clamd@scan is common for the standard configuration file. You can verify the status of the service with:

sudo systemctl status clamd@scan

Now that ClamAV is installed, definitions are updated, and the daemon is running, you are ready to perform scans. A simple command to scan a directory (for example, your home directory) recursively is:

clamscan -r /home/your_user

Replace /home/your_user with the path you wish to scan. The output will show details of the scan, including any detected threats.

For more efficient scanning, especially of large files, using the clamdscan utility which interacts with the running clamd daemon is recommended:

clamdscan -r /home/your_user

Ensure you consider SELinux policies, as they might prevent ClamAV from accessing certain files or directories. If you encounter permission errors during scans, you may need to adjust SELinux contexts or temporarily set it to permissive mode for troubleshooting (though adjusting contexts is the preferred long-term solution).

With these steps completed, you have successfully installed and configured ClamAV on your Rocky Linux 8 server, providing a vital layer of security against malicious software. Regular updates of virus definitions are key to maintaining effective protection.

Source: https://kifarunix.com/install-clamav-on-rocky-linux-8/

900*80 ad

      1080*80 ad