This post is intended to be a quick guide on how to build tmux from source on Ubuntu. tmux is a screen multiplexing program, somewhat similar to GNU screen. If you’d like a primer on tmux, feel free to check out Alek’s write up on Hacker Noon.
This will be a quick post. Partially to help anyone who wants a quick copy-paste guide to building tmux from source on Ubuntu 18.04 Bionic, and also to help me do so quickly whenever I’m bringing up a new system.
PLEASE NOTE that this guide uses my $HOME directory layout where binaries, sources, and libraries specific to my user are in $HOME/local/, not just placed in $HOME/
Without further ado, here are the commands:
sudo apt install build-essential libevent-dev libncurses5-dev autoconf git
git clone https://github.com/tmux/tmux.git
cd tmux
git checkout 2.8 # Always check for newer versions
sh autogen.sh
# NOTE: The prefixes used here are under ~/local; e.g. ~/local/src, ~/local/bin
# Many people simply have their PREFIX under $HOME
./configure --prefix=$HOME/local
make -j`nproc` # -j`nproc` parallelizes the build; omit for compatibility but slower build
make install