Skip to content

Instantly share code, notes, and snippets.

@zaiste
Created January 18, 2018 18:53
Show Gist options
  • Save zaiste/945c1e57ab7f93f72b048f94cea9db9f to your computer and use it in GitHub Desktop.
Save zaiste/945c1e57ab7f93f72b048f94cea9db9f to your computer and use it in GitHub Desktop.
Install tmux without root access (tmux 2.6, libevent 2.1.8, ncurses 6.0)
#!/bin/bash
set -e
mkdir -p $HOME/bin $HOME/src
cd $HOME/src
wget https://github.com/tmux/tmux/releases/download/2.6/tmux-2.6.tar.gz
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz
tar xvzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$HOME/bin --disable-shared
make
make install
cd ..
tar xvzf ncurses-6.0.tar.gz
cd ncurses-6.0
./configure --prefix=$HOME/bin
make
make install
cd ..
tar xvzf tmux-2.6.tar.gz
cd tmux-2.6
./configure CFLAGS="-I$HOME/bin/include -I$HOME/bin/include/ncurses" LDFLAGS="-L$HOME/bin/lib -L$HOME/bin/include/ncurses -L$HOME/bin/include"
CPPFLAGS="-I$HOME/bin/include -I$HOME/bin/include/ncurses" LDFLAGS="-static -L$HOME/bin/include -L$HOME/bin/include/ncurses -L$HOME/bin/lib" make
cp tmux $HOME/bin
cd ..
rm -rf $HOME/src
echo "$HOME/bin/tmux installed. Add $HOME/bin to your PATH."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment