This manual was designed for Debian 10. Other systems may require installation of additional dependencies.

Prepare

Purge old version of tmux:

sudo apt purge tmux

Install required development tools:

sudo apt update
sudo apt upgrade
sudo apt install autotools-dev automake build-essential libtool libtool-bin -y

Create a temporary directory:

mkdir -p /tmp/tmux-build
cd /tmp/tmux-build

ncurses

wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
tar xzf ncurses-6.1.tar.gz
cd ncurses-6.1
./configure --prefix=$HOME/.local
make -j8
make install
cd ..

libevent

wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
tar zxf libevent-2.1.11-stable.tar.gz
cd libevent-2.1.11-stable
./autogen.sh
./configure --prefix=$HOME/.local
make -j8
make install
cd ..

tmux

wget https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a.tar.gz
tar zxf tmux-3.0a.tar.gz
cd tmux-3.0a
./configure --prefix=$HOME/.local CPPFLAGS="-I$HOME/.local/include -I$HOME/.local/include/ncurses" LDFLAGS="-static -L$HOME/.local/include -L$HOME/.local/include/ncurses -L$HOME/.local/lib"
make -j8
make install

Add folder to PATH

Add to your ~/.bashrc:

export PATH="$HOME/.local/bin:$PATH"

Finally, restart your shell and launch tmux.

Links