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,
- It is dependent on libevent
- Compiling and installing on non-system folders require customized commands
- making tmux run from non-system location
Lets get started,
- 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)
- Create a non-system folder for your custom packages. I have $HOME/.usr folder on my remote machine
- Extract the downloaded files
- 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
- 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
- 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 😉