Skip to content

Instantly share code, notes, and snippets.

@hiwonjoon
Forked from joegross/build_local_tmux.sh
Last active April 30, 2020 20:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hiwonjoon/457b8dad1eaaca64f28ece7884efc727 to your computer and use it in GitHub Desktop.
Save hiwonjoon/457b8dad1eaaca64f28ece7884efc727 to your computer and use it in GitHub Desktop.
Install tmux without root
#!/bin/bash
set -e
TMUX_VERSION=2.4
LIBEVENT_VERSION=2.0.22-stable
NCURSES_VERSION=6.0
mkdir -p $HOME/.local
mkdir -p $HOME/src
cd $HOME/src
wget -N https://github.com/libevent/libevent/releases/download/release-$LIBEVENT_VERSION/libevent-$LIBEVENT_VERSION.tar.gz
tar -xzf libevent-$LIBEVENT_VERSION.tar.gz
cd libevent-$LIBEVENT_VERSION
./configure --prefix=$HOME/.local
make install
cd $HOME/src
wget -N https://ftp.gnu.org/pub/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz
tar -xzf ncurses-$NCURSES_VERSION.tar.gz
cd ncurses-$NCURSES_VERSION
./configure CPPFLAGS="-P" --prefix=$HOME/.local
make install
cd $HOME/src
wget -N https://github.com/tmux/tmux/releases/download/$TMUX_VERSION/tmux-$TMUX_VERSION.tar.gz
tar -xzf tmux-$TMUX_VERSION.tar.gz
cd tmux-$TMUX_VERSION
CFLAGS="-I$HOME/.local/include" LDFLAGS="-static -L$HOME/.local/lib" ./configure --prefix=$HOME/.local
make install
@renxida
Copy link

renxida commented Jun 4, 2018

If it tells you events.h not found,
like in here:

tmux/tmux#1084

make sure you add $HOME/.local/lib64

LDFLAGS="-static -L$HOME/.local/lib -L$HOME/.local/lib64"

on line 30.

It happened for me.

@fiennyangeln
Copy link

Thanks for this!

As for me, in case anyone got ncurses not found error at initial attempt, make sure to add CFLAGS="-I$HOME/.local/include -I$HOME/.local/include/ncurses" on line 30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment