Packages - ClamAV Documentation
Description: An open source malware detection toolkit and antivirus engine.

## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Third Party ClamAV Packages

Many Linux and Unix distributions offer one or more ClamAV packages to make it easy for you to install ClamAV.

These packages are usually well maintained but if you find an issue with one, please consider helping the volunteers that maintain the packages.

> Disclaimer: ClamAV packages may vary somewhat from the upstream version. Some examples:

> - The database and application config paths may vary:

>   - A default from-source install will go in `/usr/local`, with:

>     - applications in `/usr/local/bin`
>     - daemons in `/usr/local/sbin`
>     - libraries in `/usr/local/lib`
>     - headers in `/usr/local/include`
>     - configs in `/usr/local/etc/`
>     - databases in `/usr/local/share/clamav/`

>   - A Linux package install will probably go in `/usr`, with:

>     - applications in `/usr/bin`
>     - daemons in `/usr/sbin`
>     - libraries in `/usr/lib`
>     - headers in `/usr/include`
>     - configs in `/etc/clamav`
>     - databases in `/var/lib/clamav`

> - From-source ClamAV installations and ClamAV project provided packages require that the user create a config for FreshClam, ClamD, and ClamAV-Milter in order to use each application. Third party package installations, however, are likely to come pre-configured. Users may wish to modify the configs as needed.

> - Package installs sometimes carry extra patches for issues affecting their distribution, for issues the ClamAV developers haven’t had time to fix or are unaware of, and for security issues when distributing older versions that are no longer maintained by the ClamAV developers.

> - Some distributions parcel up ClamAV components into separate packages. You don’t necessarily need all of the packages. If this applies to your package system, you may need to review the applications described in the scanning instructions to understand which features you will need.

> Acknowledgments: Thank you to all of the volunteers who maintain these packages! We appreciate your help!

## The Packages

### Debian

Debian splits up ClamAV into a selection of different packages.

Realistically, you probably only need to `apt install clamav` and probably `apt install clamav-daemon`. If you require support for scanning compressed RAR files you first need to enable the “non-free” archive.`*`

The full list of packages includes:

- `clamav` - command-line interface
- `clamav-base` - base package
- `clamav-daemon` - scanner daemon
- `clamav-docs` - documentation
- `clamav-freshclam` - virus database update utility
- `clamav-milter` - sendmail integration
- `clamdscan` - A command-line client for `clamd` similar to `clamscan`
- `clamav-testfiles` - test files
- `libclamav-dev` - development files
- `libclamav9` - library
- `libclamunrar9` - unrar support

> `*` RAR Support: ClamAV’s RAR support comes from UnRAR, which is open-source but not entirely free in so far as its license restricts users from reverse engineering it to create RAR archives. For this reason, it is bundled separately in the “non-free” archive. Enable it by adding “non-free” to `/etc/apt/sources.list`. Eg:

> `deb http://http.us.debian.org/debian stable main contrib non-free`

> Then you can install the RAR-plugin using: `apt install libclamunrar9`

There are a variety of other ClamAV related projects as well. Run `apt search clamav` to see a larger list.

To test the installation, you can try to scan the test files in the `clamav-testfiles` package.

> Note: Debian packages are maintained by Debian’s ClamAV Team.

> The package maintainers can be reached at clamav-devel at lists.alioth.debian.org. More info at tracker.debian.org/pkg/clamav.

> Patches: https://salsa.debian.org/clamav-team/clamav/tree/unstable/debian/patches

### Ubuntu

Ubuntu’s ClamAV packages are derived from the Debian packages (above). See the Debian instructions for installation details.

> RAR Support: As with Debian, RAR support is not included in the base package. Users that desire RAR support will have to install `libclamunrar9` separately. Unlike with Debian, there is no need to enable “non-free” packages for this to work.

> Note: Ubuntu packages are curated by Ubuntu Developers. Package source: https://packages.ubuntu.com/source/clamav

### openSUSE

openSUSE provides two packages:

- `clamav` - The clamav package
- `clamav-devel` - The clamav package plus headers for software development.

#### RPM download

Find these packages at under http://download.opensuse.org/repositories/security Eg.: https://download.opensuse.org/repositories/security/16.0/x86_64/clamav-1.4.3-bp160.313.29.x86_64.rpm

Use the update variant for openSUSE, add it to your installation as another repository using YaST or zypper and give it a higher priority (lower number) than the repository that delivers the official updates.

> Tip: RPMs of new ClamAV versions for existing SUSE products are provided through the respective online update channels. As these packages have to go through QA, it usually takes some time for a new ClamAV source release to appear as an official RPM. For those who want the newest version, packages are available from the security project in the openSUSE Build Service.

#### Zypper

Install ClamAV with `zypper`:

      zypper install -y clamav

> Note: openSUSE packages are maintained by Reinhard Max.

### EPEL: AlmaLinux, RHEL, and Fedora

EPEL creates ClamAV packages for Fedora (as well as EPEL-enabled AlmaLinux). For more information on EPEL, visit their wiki.

To enable EPEL for AlmaLinux and RHEL:

    dnf install -y epel-release

EPEL offers a selection of packages to install ClamAV:

- `clamd` - The Clam AntiVirus Daemon
- `clamav` - End-user tools for the Clam Antivirus scanner
- `clamav-data` - Virus signature data for the Clam Antivirus scanner
- `clamav-devel` - Header files and libraries for the Clam Antivirus scanner
- `clamav-lib` - Dynamic libraries for the Clam Antivirus scanner
- `clamav-milter` - Milter module for the Clam Antivirus scanner
- `clamav-update` - Auto-updater for the Clam Antivirus scanner data-files

Most users will only need to run:

    dnf install -y clamav clamd clamav-update

> Tips

> AlmaLinux: The ClamAV package requires the Extra Packages for Enterprise Linux (EPEL) repository.

> RHEL: On RedHat Enterprise Linux (RHEL) the EPEL release package has to be installed either manually or through RHN.

> Fedora: Fedora packages can be found at https://src.fedoraproject.org/rpms/clamav

> Fedora’s packaging is more customized than most. Please review the RPM notes when troubleshooting your Fedora package configuration.

### Gentoo

ClamAV is available in portage under `/usr/portage/app-antivirus/clamav`

To install, run:

    emerge clamav

For more details, see the package entry on Portage.

### FreeBSD, OpenBSD, NetBSD

Although all these systems offer the possibility to use ports or pkgsrc, you can install the pre-built package:

#### FreeBSD

FreeBSD offers two ClamAV ports (packages):

- `clamav`
- `clamav-lts`

To install, run:

    pkg install clamav

and

    pkg install clamav-lts

respectively.

> Note: For more details, see:

> - https://www.freshports.org/security/clamav
> - https://www.freshports.org/security/clamav-lts

#### OpenBSD

To install, run:

      pkg_add clamav

#### NetBSD

To install, run:

      pkgin install clamav

### Solaris

OpenCSW is a community software project for Solaris 8+ on both Sparc and x86. It packages more than 2000 popular open source titles and they can all easily be installed with dependency handling via pkgutil which is modeled after Debian’s apt-get.

    pkgutil -i clamav

> Note: The package can be found on OpenCSW though it is unfortuantely quite out-of-date.

> Disclaimer: ClamAV is also no longer supported on Solaris because Solaris is proprietary, less commonly used, and difficult to work with. Future versions of ClamAV will depend on components written in the Rust programming language, which also does not support building directly on Solaris. It is likely that ClamAV will no longer work on Solaris in the future.

### Slackware

You can download ClamAV builds for Slackware from https://slackbuilds.org/repository/14.2/system/clamav/

Download the package, and as root, install it like so (substituting the appropriate filename):

      installpkg clamav.tar.gz

### macOS

ClamAV can be easily installed on macOS using one of these popular package managers:

- Homebrew: ClamAV formula
- MacPorts: ClamAV port

#### Homebrew

Install Homebrew if you don’t already have it. Then run:

      brew install clamav

Homebrew installs versioned packages to `/usr/local/Cellar/<pacakge>/<version>` with symlinks in `/usr/local/opt/<pacakge>` to the current version. Symlinks for ClamAV’s executables will be placed in `/usr/local/bin` to add them to your PATH. ClamAV’s config files will be placed in `/usr/local/etc/clamav`.

As with most other installation methods, you may need to do the following at a minimum before you can run `freshclam`, `clamscan`, or use `clamdscan` with `clamd`:

1. Create `/usr/local/etc/clamav/freshclam.conf` from `/usr/local/etc/clamav/freshclam.conf.sample`.
2. Remove or comment-out the `Example` line from `freshclam.conf`
3. Run `freshclam` to download the latest malware definitions.

If you wish to run `clamd` you’ll also need to create `/usr/local/etc/clamav/clamd.conf` from `/usr/local/etc/clamav/clamd.conf.sample`, and configure `clamd.conf` with Local/Unix socket settings (preferred), or TCP socket settings.

#### MacPorts

Install MacPorts if you don’t already have it. Then run:

      sudo port install clamav

MacPorts installs versioned packages to `/opt/local/`. ClamAV’s config files will be placed in `/opt/local/etc`.

As with most other installation methods, you may need to do the following at a minimum before you can run `freshclam`, `clamscan`, or use `clamdscan` with `clamd`:

1. Create `/opt/local/etc/freshclam.conf` from `/opt/local/etc/freshclam.conf.sample`.
2. Remove or comment-out the `Example` line from `freshclam.conf`
3. Run `freshclam` to download the latest malware definitions.

If you wish to run `clamd` you’ll also need to create `/opt/local/etc/clamd.conf` from `/opt/local/etc/clamd.conf.sample`, and configure `clamd.conf` with Local/Unix socket settings (preferred), or TCP socket settings.