configure: error: libevent not found — How to Fix (Ubuntu, Debian, CentOS)
While building a package from source on Ubuntu Linux, I hit an error at the ./configure step:
configure: error: libevent not found.

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-configis 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/libeventoption (check the exact name in./configure --help). - After installing packages, run
./configureagain — the previous result may be cached inconfig.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.