Setting up tmux without root access

At times we want access to tmux and we are just stuck due to admin restrictions or root access.

There are three important parts to setting up tmux,

  1. It is dependent on libevent
  2. Compiling and installing on non-system folders require customized commands
  3. making tmux run from non-system location

Lets get started,

  1. Download the source packages from following locations
    • tmux – https://github.com/tmux/tmux/
    • libevent – http://libevent.org/ (Check for the compatible version from tmux readme)
  2. Create a non-system folder for your custom packages. I have $HOME/.usr folder on my remote machine
  3. Extract the downloaded files
  4. Get into the libevent source folder and execute the following commands on bash
    DIR="$HOME/.usr"
    ./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib" --prefix=$DIR
    make && make install
    
  5. Get into the tmux source folder and execute following commands on bash
    sh autogen.sh
    ./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib" --prefix=$DIR
    make && make install
    
  6. In order to run tmux you will have to tweak the command by prefixing LD_PRELOAD=$HOME/.usr/lib/libevent.so
    Sample: $LD_PRELOAD=$HOME/.usr/lib/libevent.so tmux

You can (should) create alias to make life easy. In your .bash_profile or .bash_rc add the following lines

PATH=$PATH:$HOME/.usr/bin
alias tmux='LD_PRELOAD=$HOME/.usr/lib/libevent.so tmux'

 

Enjoy 😉

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *