Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

bash script for installing tmux without root access

View tmux_local_install.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#!/bin/bash
 
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
 
# exit on error
set -e
 
TMUX_VERSION=1.8
 
# create our directories
mkdir -p $HOME/local $HOME/tmux_tmp
cd $HOME/tmux_tmp
 
# download source files for tmux, libevent, and ncurses
wget -O tmux-${TMUX_VERSION}.tar.gz http://sourceforge.net/projects/tmux/files/tmux/tmux-${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz/download
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
 
# extract files, configure, and compile
 
############
# libevent #
############
tar xvzf libevent-2.0.19-stable.tar.gz
cd libevent-2.0.19-stable
./configure --prefix=$HOME/local --disable-shared
make
make install
cd ..
 
############
# ncurses #
############
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$HOME/local
make
make install
cd ..
 
############
# tmux #
############
tar xvzf tmux-${TMUX_VERSION}.tar.gz
cd tmux-${TMUX_VERSION}
./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"
CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make
cp tmux $HOME/local/bin
cd ..
 
# cleanup
rm -rf $HOME/tmux_tmp
 
echo "$HOME/local/bin/tmux is now available. You can optionally add $HOME/local/bin to your PATH."

Oh - thank you, thank you, thank you. They only had screen at work. Now I can use tmux and be happy :)

Thank you! This worked perfectly for me.

Thanks so much, installed perfectly right out of the box. I hate having to figure out what libraries I need and where to get them for local installs, this saved me probably hours of pain (or from just continuing to use screen on machines I don't have root access for)...

I modified it to link statically and the resultant binary worked on a different system with different libc: https://gist.github.com/haridsv/5040047

shime commented

Thanks!

Forked this and made it more customizable, updated versions of installed components and provided auto-install command.

Check it out at https://gist.github.com/shime/5706655.

Thank you for this script. Clearly and really helped.

Worked on BLUEHOST.com just FYI

Oh man, thanks for this. So much time savings.

Thanks :)

Thank you so much! I got an ssh account to a cluster from my university, but it doesn't have Tmux installed. Now with your script, my life is much easier!

You are a king among men. ;) Kudos to you-

Many, many, many thanks for this.

Brilliant! thank you

so brilliant! 

Fantastic, thanks!

jingz commented

awesome thanks!

Thanks! Cannot stand screen. Now to waste some hours trying to understand why what I tried failed...

Thanks!

At the risk of repeated others, thanks so much for this! I've used it as a base to install Vim and tig as well. For the life of me couldn't figure out how to do it before now!

thanks

This is awesome, thanks so much! We only have screen at work so getting tmux was a must.

I met a problem when exec
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz

--2014-10-23 11:08:44-- https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
Resolving github.com... 192.30.252.128
Connecting to github.com|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz [following]
--2014-10-23 11:08:46-- https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
Resolving cloud.github.com... 54.230.125.200, 205.251.212.199, 54.230.126.47, ...
Connecting to cloud.github.com|54.230.125.200|:443... connected.
OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
Unable to establish SSL connection.

my os is centos6.5 64bit

I had the same problem. I manually downloaded libevent-2.0.19-stable.tar.gz and then everything worked fine.

Thanks.

Got the following error:
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

Had to:
export LD_LIBRARY_PATH=/path/to/my/home/local/lib/:${LD_LIBRARY_PATH}

@jiacai2050 change the
wget
to:
curl -L -O

with curl -L -O I'm getting error SSL routines: SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
with curl -O I can download something but is not a tar ball

Very useful shell script, thank you!

Works great!

Shouldn't it be -L$HOME/local/lib/ncurses instead of -L$HOME/local/include/ncurses ?

This worked perfectly on Inmotion.com shared server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.