Skip to content

Instantly share code, notes, and snippets.

@diligasi
Created February 7, 2019 17:06
Show Gist options
  • Save diligasi/8d26aab27dea3aae467357bbbed1f5c2 to your computer and use it in GitHub Desktop.
Save diligasi/8d26aab27dea3aae467357bbbed1f5c2 to your computer and use it in GitHub Desktop.
A guide for install and/or update tmux on Ubuntu and similar distros

Prepare system for new installation

# Before start, make sure you've killed all old tmux servers that
# could be still running in the background
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

# Define the wanted version, for example 2.8
VERSION=2.8

# 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

# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment