libevent error when installing tmux_1.8 on Ubuntu 12.04

mingchaoyan picture mingchaoyan · Jun 12, 2013 · Viewed 8.3k times · Source

I want to install tmux 1.8 on my ubuntu 12.04 after

tar zxvf tmux-1.8.tar.gz
cd tmux_1.8
./configure

but here is some error infomation,

...
checking pkg-config is at least version 0.9.0... yes
checking for LIBEVENT... no
checking for library containing event_init... no
configure: error: "libevent not found"
mingchaoyan@mingchaoyan-VirtualBox:~/Downloads/tmux-1.8$ sudo apt-get install libevent
[sudo] password for mingchaoyan:   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libevent

I try to apt-get install libevent, but fail. Can anyone help me how to solve this problem. It will be greatful if you explain why.

Answer

marc-andre benoit picture marc-andre benoit · Feb 14, 2014

When looking on the tmux installation page you can see two things mentioned.

That the tmux installation needs :

  • libevent
  • ncurses

Enter the following command in terminal to solve these two dependencies.

sudo apt-get install libevent-dev libncurses-dev pkg-config

Then this following command will force(f) a reconfiguration of the gnu build system(make among others) to help install(i) new components (libevent and ncurses) and create symbolic (s) links to the new components.

autoreconf -fis

If you're installing from the tarball (.tar.gz file)

All you have left to do is to configure and make with those commands.

./configure && make

And make install for a local installation or sudo make install for a global installation.

If you decided to install from source with these commands.

git clone git://git.code.sf.net/p/tmux/tmux-code tmux [deprecated]
git clone https://github.com/tmux/tmux.git [newest source]
cd tmux

This command will verify if everything is there and that all dependencies are met when compiling from source.

sh autogen.sh

You can then then run ./configure && makeand eithermake installorsudo make install like explained above.

Sources used:
- How to install new tmux 1.8 on Ubuntu 12.10 or 12.04?
- tmux README file