configure: error: libevent not found — How to Fix (Ubuntu, Debian, CentOS)

Category: Servers & Websites
Posted: October 5, 2019
Author: Antonio

While building a package from source on Ubuntu Linux, I hit an error at the ./configure step:

configure: error: libevent not found.

configure: error: libevent not found — How to Fix (Ubuntu, Debian, CentOS)

In short: the libevent header files are missing. Install the development package — libevent-dev on Ubuntu and Debian — and run ./configure again.

Fix for Ubuntu and Debian

apt install libevent-dev

The libevent library itself is often already installed — many programs use it. But building from source also needs the header files (.h), and those live in a separate package with the -dev suffix.

CentOS, Fedora, RHEL

There, development packages use the -devel suffix:

yum install libevent-devel

If the error persists

  • Make sure pkg-config is installed — configure often uses it to find libraries: apt install pkg-config.
  • If libevent was built manually and lives in a non-standard place, give the path: many programs have a ./configure --with-libevent=/path/to/libevent option (check the exact name in ./configure --help).
  • After installing packages, run ./configure again — the previous result may be cached in config.cache, so delete it.

The same rule applies to other “configure: error: library not found” errors: look for the name-dev (or name-devel) package.

Related posts:

Leave a Comment

Copying content from this site is allowed only with a direct link to the source - https://nemcd.com