What is tmux?
tmux is a “terminal multiplexer”, it enables a number of terminals (or windows) to be accessed and controlled from a single terminal. If one downloads tmux from ubuntu repositories, it’s version is 2.1 while the latest version under development and enhanced with features is 2.6
Download and Build tmux dependencies
We can download package information from all configured sources:
$ sudo apt update
We need to install git in order to download latest version of tmux from official repository.
$ sudo apt install -y git
Inorder to get the latest version of tmux, we’ll be compiling and installing the software from source. We need to satisfy the build and tmux dependencies so that we can compile the software. We need to install automake
, build-essential
, pkg-config
, libevent-dev
, libncurses5-dev
packages for this.
$ sudo apt install -y automake
$ sudo apt install -y build-essential
$ sudo apt install -y pkg-config
$ sudo apt install -y libevent-dev
$ sudo apt install -y libncurses5-dev
Download, Compile and Install tmux
We need to choose the target directory where we’ll download tmux.
Let’s download in the /tmp/tmux
. Before downloading we need to remove /tmp/tmux
to ensure that this directory isn’t busy:
$ rm -rf /tmp/tmux
Download tmux to /tmp/tmux
:
$ git clone https://github.com/tmux/tmux.git /tmp/tmux
Go to the /tmp/tmux
directory:
$ cd /tmp/tmux
Execute autogen.sh
file:
$ sh autogen.sh
Configure and compile the tmux binaries:
$ ./configure && make
Install the binaries into the system:
$ sudo make install
Go back the previous directory:
$ cd -
We don’t need to keep the downloaded tmux binaries, so we can remove /tmp/tmux
:
$ rm -rf /tmp/tmux
Completing all steps above now we can use the latest tmux
.
A shell script has been made for you. No need to copy and paste commands. Cheers !!!