How To Install clamav on CentOS 8

clamav is End-user tools for the Clam Antivirus scanner

Introduction

In this tutorial we learn how to install clamav on CentOS 8.

What is clamav

Clam AntiVirus is an anti-virus toolkit for UNIX. The main purpose of this software is the integration with mail servers (attachment scanning). The package provides a flexible and scalable multi-threaded daemon, a command line scanner, and a tool for automatic updating via Internet. The programs are based on a shared library distributed with the Clam AntiVirus package, which you can use with your own software. The virus database is based on the virus database from OpenAntiVirus, but contains additional signatures (including signatures for popular polymorphic viruses, too) and is KEPT UP TO DATE.

We can use yum or dnf to install clamav on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install clamav.

Install clamav on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install clamav using dnf by running the following command:

sudo dnf -y install clamav

Install clamav on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install clamav using yum by running the following command:

sudo yum -y install clamav

How To Uninstall clamav on CentOS 8

To uninstall only the clamav package we can use the following command:

sudo dnf remove clamav

clamav Package Contents on CentOS 8

/usr/bin/clambc
/usr/bin/clamconf
/usr/bin/clamdscan
/usr/bin/clamdtop
/usr/bin/clamscan
/usr/bin/clamsubmit
/usr/bin/sigtool
/usr/lib/.build-id
/usr/lib/.build-id/14
/usr/lib/.build-id/14/c436c628ccf266fbf20f33c619bcf819522dfb
/usr/lib/.build-id/1e
/usr/lib/.build-id/1e/060a5212faf3db3c759b41a3c998c502d6214f
/usr/lib/.build-id/63
/usr/lib/.build-id/63/2147b1421fffa8c8c64a8fee00294aa497a38d
/usr/lib/.build-id/81
/usr/lib/.build-id/81/8d6460b2f44d48dcf1cf1962b6a60b7c5bc835
/usr/lib/.build-id/84
/usr/lib/.build-id/84/960f0fc1c0bb2c40374eeec1b113c64900d359
/usr/lib/.build-id/96
/usr/lib/.build-id/96/826d376c5e7d34b2f5d33e2489bf21cf42dc2e
/usr/lib/.build-id/b4
/usr/lib/.build-id/b4/f141e0c1c9900476f8fa0863503a299d97181f
/usr/lib/.build-id/b6
/usr/lib/.build-id/b6/19bfcbaa2802461ba915672dbf4c6c24f6812b
/usr/lib/systemd/system/clamav-clamonacc.service
/usr/lib/systemd/system/clamonacc.service
/usr/sbin/clamonacc
/usr/share/doc/clamav
/usr/share/doc/clamav/NEWS.md
/usr/share/doc/clamav/README.md
/usr/share/doc/clamav/html
/usr/share/doc/clamav/html/UserManual
/usr/share/doc/clamav/html/UserManual.html
/usr/share/doc/clamav/html/UserManual/Contribute.html
/usr/share/doc/clamav/html/UserManual/Installation-Unix
/usr/share/doc/clamav/html/UserManual/Installation-Unix.html
/usr/share/doc/clamav/html/UserManual/Installation-Unix/Steps-Debian-Ubuntu.html
/usr/share/doc/clamav/html/UserManual/Installation-Unix/Steps-Redhat-CentOS.html
/usr/share/doc/clamav/html/UserManual/Installation-Unix/Steps-macOS.html
/usr/share/doc/clamav/html/UserManual/Installation-Windows.html
/usr/share/doc/clamav/html/UserManual/Introduction.html
/usr/share/doc/clamav/html/UserManual/OnAccess.html
/usr/share/doc/clamav/html/UserManual/Signatures
/usr/share/doc/clamav/html/UserManual/Signatures.html
/usr/share/doc/clamav/html/UserManual/Signatures/AllowLists.html
/usr/share/doc/clamav/html/UserManual/Signatures/AuthenticodeRules.html
/usr/share/doc/clamav/html/UserManual/Signatures/BodySignatureFormat.html
/usr/share/doc/clamav/html/UserManual/Signatures/BytecodeSignatures.html
/usr/share/doc/clamav/html/UserManual/Signatures/ContainerMetadata.html
/usr/share/doc/clamav/html/UserManual/Signatures/DatabaseInfo.html
/usr/share/doc/clamav/html/UserManual/Signatures/DynamicConfig.html
/usr/share/doc/clamav/html/UserManual/Signatures/EncryptedArchives.html
/usr/share/doc/clamav/html/UserManual/Signatures/ExtendedSignatures.html
/usr/share/doc/clamav/html/UserManual/Signatures/FileTypeMagic.html
/usr/share/doc/clamav/html/UserManual/Signatures/FileTypes.html
/usr/share/doc/clamav/html/UserManual/Signatures/FunctionalityLevels.html
/usr/share/doc/clamav/html/UserManual/Signatures/HashSignatures.html
/usr/share/doc/clamav/html/UserManual/Signatures/LogicalSignatures.html
/usr/share/doc/clamav/html/UserManual/Signatures/PhishSigs.html
/usr/share/doc/clamav/html/UserManual/Signatures/YaraRules.html
/usr/share/doc/clamav/html/UserManual/Usage
/usr/share/doc/clamav/html/UserManual/Usage.html
/usr/share/doc/clamav/html/UserManual/Usage/Configuration.html
/usr/share/doc/clamav/html/UserManual/Usage/Scanning.html
/usr/share/doc/clamav/html/UserManual/Usage/SignatureManagement.html
/usr/share/doc/clamav/html/UserManual/development.html
/usr/share/doc/clamav/html/UserManual/images
/usr/share/doc/clamav/html/UserManual/images/demon.png
/usr/share/doc/clamav/html/UserManual/libclamav.html
/usr/share/licenses/clamav
/usr/share/licenses/clamav/COPYING
/usr/share/man/man1/clambc.1.gz
/usr/share/man/man1/clamconf.1.gz
/usr/share/man/man1/clamdscan.1.gz
/usr/share/man/man1/clamdtop.1.gz
/usr/share/man/man1/clamscan.1.gz
/usr/share/man/man1/clamsubmit.1.gz
/usr/share/man/man1/sigtool.1.gz
/usr/share/man/man5/clamav-milter.conf.5.gz
/usr/share/man/man8/clamonacc.8.gz
/var/spool/quarantine

References

Summary

In this tutorial we learn how to install clamav on CentOS 8 using yum and dnf.