Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tmux local installation without root
#!/bin/bash
#
# Add the following lines to .bashrc before running the script
#
# export SCRATCH=/scratch/$USER
# export XDG_DATA_DIRS=$XDG_DATA_DIRS:$SCRATCH/.local/share
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCRATCH/.local/lib
# export PATH=$PATH:$SCRATCH/.local/bin
set -e
tmuxver=2.2
libeventver=2.0.22
DESTDIR=$SCRATCH/.local
mkdir -p /tmp/libevent
mkdir -p /tmp/tmux
mkdir -p $DESTDIR
# Install libevent
cd /tmp/libevent
wget https://github.com/libevent/libevent/archive/release-$libeventver-stable.zip
unzip release-$libeventver-stable
cd libevent-release-$libeventver-stable
./autogen.sh
./configure --prefix=$DESTDIR --sysconfdir=$DESTDIR/etc
make
make check
make install
# Install tmux
cd /tmp/tmux
wget https://github.com/tmux/tmux/releases/download/$tmuxver/tmux-$tmuxver.tar.gz
tar xzf tmux-$tmuxver.tar.gz
cd tmux-$tmuxver
LDFLAGS="-L$DESTDIR/lib" CFLAGS="-I$DESTDIR/include" ./configure --prefix=$DESTDIR
make
make install
rm -r /tmp/libevent /tmp/tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment