Prepare system for new installation

Before start, make sure you’ve killed all old tmux servers that

could be still running in the background

1
2
3
4
5
6
7
sudo killall -9 tmux

# Remove any previous installation
sudo apt-get -y remove tmux
  
# Install needed dependences
sudo apt-get -y install wget tar libevent-dev libncurses-dev

Download source and unpack

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Define the wanted version, for example 3.5
VERSION=3.5
    
# Download the wanted version
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
    
# Unpack it and remove the compressed file

tar xf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz

Build and install

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Assuming the same version from last session, access the created folder
# and run the configure script to check if you have everything needed to
# build the application, builds the source code with make and then moves
# all the needed files for the application to the appropriate system
# directories with the make install command

cd tmux-${VERSION}
./configure
make
sudo make install

# Now cleanup the mess and happy hack! =)
cd -
sudo rm -rf /usr/local/src/tmux-\*
sudo mv tmux-${VERSION} /usr/local/src