Knowledgebase

Oracle Linux Antivirus (clamav, freshclam, clamscan, clamtk) Print

  • Oracle, Linux, Antivirus, clamav
  • 2

# yum install clamav clamav-update

If you are using Oracle Linux, you can use EPEL from the Oracle Yum repository. Enable EPEL using the following commands.

# OL9
dnf install -y oraclelinux-release-el9

# OL8
dnf install -y oraclelinux-release-el8

# OL7
yum install -y oraclelinux-release-el7

Edit the "/etc/freshclam.conf" file, commenting out the word "Example" on line 8 if it is not already commented.

 

Update Virus Definitions (freshclam)

Once ClamAV is installed you will need to update the virus definitions. This is done using the freshclam command.

# freshclam

This will need to be done on a regular basis, so it would be sensible to schedule it by including it in the crontab for the "root" user. The text shows a possible crontab entry to refresh the virus definitions every day at 10:00.

# Update ClamAV virus definitions
0 10 * * * /usr/bin/freshclam

Performing Scans (clamscan)

Scans are initiated from the command line using the clamscan command, as shown below.

# # Scan a specific file.
# clamscan /tmp/test.txt

# # Scan the contents of a directory.
# clamscan /u01

# # Scan the contents of a directory and all sub-directories.
# clamscan -r /u01

Regular scans can be scheduled by including these commands in the "root" users crontab. An example entry is shown below scans the "/u01" directory every day at 11:00.

# AntiVirus scan.
0 11 * * * /usr/bin/clamscan --detect-pua -i -r /u01 --log="$HOME/.clamtk/history/$(date +\%b-\%d-\%Y).log" 2>/dev/null

The clamscan command has many options to tailor the action of scans, so check the man pages.

ClamTk GUI

ClamTk provides a GUI front end for ClamAV. On Fedora it is installed using the following command.

# yum install clamtk

Remember to run ClamTk as the "root" user, either directly or using sudo.

# clamtk &

or

$ sudo clamtk &

The GUI is fairly self explanatory.


Was this answer helpful?
« Back