How To Install clamav on CentOS 7

In this tutorial we learn how to install clamav on CentOS 7. clamav is End-user tools for the Clam Antivirus scanner

Introduction

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

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 7. In this tutorial we discuss both methods but you only need to choose one of method to install clamav.

Install clamav on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install clamav

Install clamav on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install clamav

How To Uninstall clamav on CentOS 7

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

sudo dnf remove clamav

References

Summary

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