Attempting to install tmux on CentOS 6.x fails with error: ‘EVBUFFER_EOL_LF’ undeclared
The issue occurs because yum installs libevent version 1.4 whereas tmux 1.9 requires libevent version 2.0. The solution is to install libevent version 2.0 from the source.
Here is the complete set of commands to install tmux from scratch.
yum -y install ncurses-devel
wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xvzf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure
make -j 4
make install
cd ..
wget https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
tar -xvzf tmux-2.1.tar.gz
cd tmux-2.1
./configure LDFLAGS="-Wl,-rpath,/usr/local/lib"
make -j 4
make install
There are three blocks of commands here.
- The yum command installs the ncurses-devel package (if it is not already present) required to compile tmux.
- Then we compile libevent version 2.0 from source and install it.
- Then we compile tmux version 2.1 from source and install it. While doing so, we ensure that we link tmux to libevent that we installed in /usr/local/lib, otherwise would get this error:
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
.
Finally, execute the tmux
command to launch tmux.
Install libevent2-devel instant of libevent-devel
on my 64bit machine:
yum install libevent2-devel.x86_64
If you already have libevent-devel installed, uninstall it first.