#!/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." |
This comment has been minimized.
This comment has been minimized.
Thank you! This worked perfectly for me. |
This comment has been minimized.
This comment has been minimized.
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)... |
This comment has been minimized.
This comment has been minimized.
I modified it to link statically and the resultant binary worked on a different system with different libc: https://gist.github.com/haridsv/5040047 |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
Thank you for this script. Clearly and really helped. |
This comment has been minimized.
This comment has been minimized.
Worked on BLUEHOST.com just FYI |
This comment has been minimized.
This comment has been minimized.
Oh man, thanks for this. So much time savings. |
This comment has been minimized.
This comment has been minimized.
Thanks :) |
This comment has been minimized.
This comment has been minimized.
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! |
This comment has been minimized.
This comment has been minimized.
You are a king among men. ;) Kudos to you- |
This comment has been minimized.
This comment has been minimized.
Many, many, many thanks for this. |
This comment has been minimized.
This comment has been minimized.
Brilliant! thank you |
This comment has been minimized.
This comment has been minimized.
so brilliant! |
This comment has been minimized.
This comment has been minimized.
Fantastic, thanks! |
This comment has been minimized.
This comment has been minimized.
awesome thanks! |
This comment has been minimized.
This comment has been minimized.
Thanks! Cannot stand screen. Now to waste some hours trying to understand why what I tried failed... |
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
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! |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
This is awesome, thanks so much! We only have screen at work so getting tmux was a must. |
This comment has been minimized.
This comment has been minimized.
I met a problem when exec --2014-10-23 11:08:44-- https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz my os is centos6.5 64bit |
This comment has been minimized.
This comment has been minimized.
I had the same problem. I manually downloaded libevent-2.0.19-stable.tar.gz and then everything worked fine. |
This comment has been minimized.
This comment has been minimized.
Thanks. |
This comment has been minimized.
This comment has been minimized.
Got the following error: Had to: |
This comment has been minimized.
This comment has been minimized.
@jiacai2050 change the |
This comment has been minimized.
This comment has been minimized.
with curl -L -O I'm getting error SSL routines: SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
Very useful shell script, thank you! |
This comment has been minimized.
This comment has been minimized.
Excellent, thank you! |
This comment has been minimized.
This comment has been minimized.
Works great! |
This comment has been minimized.
This comment has been minimized.
Shouldn't it be |
This comment has been minimized.
This comment has been minimized.
This worked perfectly on Inmotion.com shared server. |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
thanks, worked on redhat 4.4 fine |
This comment has been minimized.
This comment has been minimized.
Other alternative could be to fetch the static binary with static-get, no compiler required =)
To list all available versions: sh <(wget -qO- s.minos.io/s) -s -v tmux |
This comment has been minimized.
This comment has been minimized.
Other alternative could be to fetch the static binary with static-get, no compiler required =)
To list all available versions: sh <(wget -qO- http://s.minos.io/s) -s -v tmux |
This comment has been minimized.
This comment has been minimized.
Other alternative could be to fetch the static binary with static-get, no compiler required =)
To list all available versions: sh <(wget -qO- http://s.minos.io/s) -s -v tmux |
This comment has been minimized.
This comment has been minimized.
Other alternative could be to fetch the static binary with static-get, no compiler required =) sh <(wget -qO- http://s.minos.io/s) -x tmux-2.0 To list all available versions: sh <(wget -qO- http://s.minos.io/s) -v -s tmux |
This comment has been minimized.
This comment has been minimized.
The WGET SSL error is due to an old version of wget not supporting SNI, just replace the line that download libevent source by this one :
|
This comment has been minimized.
This comment has been minimized.
mathieupoussin thx u fix ssl error i got |
This comment has been minimized.
This comment has been minimized.
This is great! |
This comment has been minimized.
This comment has been minimized.
Awesome script! I forked it to use automatically the latest version of tmux (currently version 2.1) from the github repo: https://github.com/jealie/install_tmux This version relies on |
This comment has been minimized.
This comment has been minimized.
Amazing script! |
This comment has been minimized.
This comment has been minimized.
Nice! |
This comment has been minimized.
This comment has been minimized.
Thanks, great work! |
This comment has been minimized.
This comment has been minimized.
I'm getting 404 errors when trying to wget the tmux tarball. Does this need to be updated? SourceForge doesn't seem to have tmux version 2.2. |
This comment has been minimized.
This comment has been minimized.
For version 2.2:
|
This comment has been minimized.
This comment has been minimized.
nice! Thanks. Also for version 2.2! |
This comment has been minimized.
This comment has been minimized.
I just tried this script with version 2.2 on a fresh linux install (apricityos) and got this error:
|
This comment has been minimized.
This comment has been minimized.
I managed to compile
Is there any way to change the compilation to include these libraries ? |
This comment has been minimized.
This comment has been minimized.
If anyone comes looking for it, this is the script that was able to install the latest version of tmux:
|
This comment has been minimized.
This comment has been minimized.
With the latest script in the comment, I had the following compiler error. Any ideas? cc -DPACKAGE_NAME="tmux" -DPACKAGE_TARNAME="tmux" -DPACKAGE_VERSION="2.2" -DPACKAGE_STRING="tmux\ 2.2" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="tmux" -DVERSION="2.2" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_PATHS_H=1 -DHAVE_PTY_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_DIRFD=1 -DHAVE_FLOCK=1 -DHAVE_SYSCONF=1 -DHAVE_CFMAKERAW=1 -DHAVE_B64_NTOP=1 -DHAVE_FORKPTY=1 -DHAVE_DAEMON=1 -DHAVE_SETENV=1 -DHAVE_ASPRINTF=1 -DHAVE_STRCASESTR=1 -DHAVE_STRSEP=1 -DHAVE_CFMAKERAW=1 -DHAVE_OPENAT=1 -DHAVE_DECL_OPTARG=1 -DHAVE_DECL_OPTIND=1 -DHAVE_DECL_OPTRESET=0 -DHAVE_BSD_TYPES=1 -DHAVE___PROGNAME=1 -DHAVE_PROC_PID=1 -I. -I/usr/include/ncursesw -DTMUX_CONF=""/etc/tmux.conf"" -iquote. -I/home/phd/e1696798/programs/libevent/include -I/home/phd/e1696798/programs/ncurses/include/ncurses -D_GNU_SOURCE -std=gnu99 -O2 -MT tty-term.o -MD -MP -MF $depbase.Tpo -c -o tty-term.o tty-term.c && |
This comment has been minimized.
This comment has been minimized.
Thank you very much! Really clean script with everything in one place! |
This comment has been minimized.
This comment has been minimized.
Thank you! This worked great for me!! |
This comment has been minimized.
This comment has been minimized.
Thank you! |
This comment has been minimized.
This comment has been minimized.
xapple's script miss some include directory, script below works OK for me:
|
This comment has been minimized.
This comment has been minimized.
Thanks for your share!!! but the source files for tmux could be changed. I take a long time to find the solution:
use above addr instead. good luck! |
This comment has been minimized.
This comment has been minimized.
great script, thanks! |
This comment has been minimized.
This comment has been minimized.
Great script, thanks! |
This comment has been minimized.
This comment has been minimized.
Really thanks! I needed to adjust the wgets for the new version but it is working now |
This comment has been minimized.
This comment has been minimized.
Updated to latest version (2.3) and using github instead of sourceforge - https://gist.github.com/crobicha/f99b5f626c47473a184003ae1fc597d4 I would create a pull-request but it seems like that's only a git concept, not in gist? |
This comment has been minimized.
This comment has been minimized.
I met the following problem when make ncurses
|
This comment has been minimized.
This comment has been minimized.
awesome~ |
This comment has been minimized.
This comment has been minimized.
Just removed the last three backquote from the above script and finally works fine without thinking. # Exit on error #
set -e
# Clean up #
rm -rf ~/tools/programs/libevent
rm -rf ~/tools/programs/ncurses
rm -rf ~/tools/programs/tmux
# Variable version #
TMUX_VERSION=2.2
# Create our directories #
mkdir -p ~/tools/test
mkdir -p ~/tools/programs/libevent
mkdir -p ~/tools/programs/ncurses
mkdir -p ~/tools/programs/tmux
############
# libevent #
############
cd ~/tools/test
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
tar xvzf libevent-2.0.19-stable.tar.gz
cd libevent-*/
./configure --prefix=$HOME/tools/programs/libevent --disable-shared
make
make install
############
# ncurses #
############
cd ~/tools/test
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$HOME/tools/programs/ncurses LDFLAGS="-static"
make
make install
############
# tmux #
############
cd ~/tools/test
wget -O tmux-${TMUX_VERSION}.tar.gz https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
tar xvzf tmux-${TMUX_VERSION}.tar.gz
cd tmux-${TMUX_VERSION}
# open configure and find the line that says:
# PKG_CONFIG="pkg-config --static"
# And comment it out:
# #PKG_CONFIG="pkg-config --static"
# Build #
./configure --prefix=$HOME/tools/programs/tmux --enable-static CFLAGS="-I$HOME/tools/programs/libevent/include -I$HOME/tools/programs/ncurses/include/ncurses -I$HOME/tools/programs/ncurses/include/" LDFLAGS="-static -L$HOME/tools/programs/libevent/lib -L$HOME/tools/programs/libevent/include -L$HOME/tools/programs/ncurses/lib -L$HOME/tools/programs/ncurses/include/ncurses" PKG_CONFIG=/bin/false
CPPFLAGS="-I$HOME/tools/programs/libevent/include -I$HOME/tools/programs/ncurses/include/ncurses" LDFLAGS="-static -L$HOME/tools/programs/libevent/lib -L$HOME/tools/programs/libevent/include -L$HOME/tools/programs/ncurses/lib -L$HOME/tools/programs/ncurses/include/ncurses" make
# Move #
cp tmux ~/bin/tmux |
This comment has been minimized.
This comment has been minimized.
Thanks a lot for your codes! I would like to ask why sometimes there is 'prefix' when configure tmux and sometimes not? If not, where do we indicate tmux should be installed? And why there are two LDFLAGS (almost the same) when configuring tmux? @dexhunter @thinki @xapple @ryin @crobicha |
This comment has been minimized.
This comment has been minimized.
Thank you for your script, it helps me a lot. However, it must be better to update download link of latest sources of tmux, ncurses and libevent. I replace them in "# download source files for tmux, libevent, and ncurses" section by the following:
and tmux version should be changed firstly: |
This comment has been minimized.
This comment has been minimized.
Edited the script to have right folder path, based on @ZhouYL0213 comment,
|
This comment has been minimized.
This comment has been minimized.
@smilesun run |
This comment has been minimized.
This comment has been minimized.
I have trouble with configuring tmux: libevent is not found. Executing the above scripts gives: ... edit: the LDFLAGS was missing $HOME/local/lib64 for libevent. adding -L$HOME/local/lib64 to LDFLAGS in the tmux ./configure and make calls fixed this. |
This comment has been minimized.
This comment has been minimized.
I use script of @yogeshpv, and it works now. |
This comment has been minimized.
This comment has been minimized.
@smilesun Modify ncurses source code as below:
|
This comment has been minimized.
This comment has been minimized.
Thanks a lot mate. You are a life saver. |
This comment has been minimized.
This comment has been minimized.
Hey there, I tried to run this but |
This comment has been minimized.
This comment has been minimized.
Just updated the links and it is working perfectly. Thanks a lot for saving a lot of my time! |
This comment has been minimized.
This comment has been minimized.
I used the solution in @yogeshpv 's comment. It worked with only one modification: cd to new version of ncurses (as of right now it is ncurses-6.1). Thanks! |
This comment has been minimized.
This comment has been minimized.
Thank you so much! |
This comment has been minimized.
This comment has been minimized.
#!/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=2.5
# 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 https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
wget http://invisible-island.net/datafiles/release/ncurses.tar.gz
# extract files, configure, and compile
############
# libevent #
############
tar xvzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$HOME/local --disable-shared
make
make install
cd ..
############
# ncurses #
############
tar xvzf ncurses.tar.gz
cd ncurses-6.1
./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." |
This comment has been minimized.
This comment has been minimized.
The links to Have fixed them (i.e. hardcoded) to the correct filenames. Also, bumped
|
This comment has been minimized.
This comment has been minimized.
Thanks @musically-ut . Your fixes worked for me. |
This comment has been minimized.
This comment has been minimized.
@musically-ut, I see that you put some include dir for |
This comment has been minimized.
This comment has been minimized.
@musically-ut script works. Thanks a lot! |
This comment has been minimized.
This comment has been minimized.
To use the latest tmux release v2.8, the following works for me (notice you need to do #!/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=2.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 https://github.com/tmux/tmux/archive/${TMUX_VERSION}.tar.gz
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 -j
make install
cd ..
############
# ncurses #
############
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$HOME/local
make -j
make install
cd ..
############
# tmux #
############
tar xvzf tmux-${TMUX_VERSION}.tar.gz
cd tmux-${TMUX_VERSION}
./autogen.sh
./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." |
This comment has been minimized.
This comment has been minimized.
Everything is right But when I run |
This comment has been minimized.
This comment has been minimized.
@StevenShi-23 script is breaking in with I am using CentOS 6.10. Any ideas? |
This comment has been minimized.
This comment has been minimized.
Thanks for the help. This worked for me on Red Hat Enterprise Linux Server release 6.9 (Santiago). My ~/.bashrc also contains export PATH="$PATH:$HOME/local/bin" to make tmux accessible everywhere. |
This comment has been minimized.
This comment has been minimized.
Just updated links of latest tmux and it worked perfectly. Thanks! |
This comment has been minimized.
This comment has been minimized.
Thank you @mnsmar |
This comment has been minimized.
This comment has been minimized.
The above from @StevenShi-23 and @amlestin (including the part about adding to $PATH) worked for me on Centos 7.6. Thanks! |
This comment has been minimized.
This comment has been minimized.
I updated for 2.9a.
|
This comment has been minimized.
This comment has been minimized.
Curious, why not use Not a big difference, but you are missing the man page: make[1]: Entering directory `/home/flakrat/sources/tmux-2.9a'
/usr/bin/mkdir -p '/home/flakrat/local/bin'
/usr/bin/install -c tmux '/home/flakrat/local/bin'
make install-exec-hook
make[2]: Entering directory `/home/flakrat/sources/tmux-2.9a'
if test xmdoc = xmdoc; then \
sed -e "s|@SYSCONFDIR@|/etc|g" ./tmux.1 \
>./tmux.1.mdoc; \
else \
sed -e "s|@SYSCONFDIR@|/etc|g" ./tmux.1| \
gawk -f ./mdoc2man.awk >./tmux.1.man; \
fi
/usr/bin/mkdir -p /home/flakrat/local/share/man/man1
/usr/bin/install -c -m 644 ./tmux.1.mdoc \
/home/flakrat/local/share/man/man1/tmux.1 |
This comment has been minimized.
This comment has been minimized.
Note: The latest version of tmux (3.0a) is distributed as an Appimage. So you can simply download the Appimage and either:
|
This comment has been minimized.
Oh - thank you, thank you, thank you. They only had screen at work. Now I can use tmux and be happy :)