Skip to content

Instantly share code, notes, and snippets.

@jamesfrank
Forked from todgru/_readme.md
Last active August 5, 2018 02:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesfrank/ee1d415d96902c754b4824734084180a to your computer and use it in GitHub Desktop.
Save jamesfrank/ee1d415d96902c754b4824734084180a to your computer and use it in GitHub Desktop.
Installing Tmux on Dreamhost tmux dreamhost
#!/bin/bash
# Based on this: http://blennd.com/post/the-pains-of-installing-tmux-on-a-shared-server/
# Script forked from https://gist.github.com/shime/5706655/
# Script for installing tmux and dependencies.
# tmux will be executable from ~/local/lib.
# Prerequisites: - gcc
# - wget
# define versions
tmux_version="2.1"
libevent_version="2.1.8"
tmux_name="tmux-$tmux_version"
libevent_name="libevent-$libevent_version-stable"
# Create working directories
mkdir -p ~/local
mkdir -p ~/temp
# download source files for tmux, libevent
# save them in ~/temp
cd ~/temp
wget -O $tmux_name.tar.gz https://github.com/tmux/tmux/releases/download/$tmux_version/$tmux_name.tar.gz
wget -O $libevent_name.tar.gz https://github.com/libevent/libevent/releases/download/release-$libevent_version-stable/$libevent_name.tar.gz
# extract files, configure, and compile
# libevent installation
tar xvzf $libevent_name.tar.gz
cd $libevent_name
./configure --prefix=$HOME/local
make
make install
cd -
# tmux installation
tar xvzf $tmux_name.tar.gz
cd $tmux_name
DIR="$HOME/local"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
make
cp tmux ~/local/bin
cd -
# Add path to .bashrc
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="$HOME/local/lib"' >> ~/.bashrc
cd ~
source ~/.bashrc
echo
echo "//////////////////////////////////////////////////////////"
echo "Post installation message:"
echo "----------------------------------------------------------"
echo "Installed tmux v$tmux_version with success! \o/"
echo
echo "Hit 'tmux -V' to make sure you're using the right version."
echo "//////////////////////////////////////////////////////////"
echo
@jacksenechal
Copy link

Thanks, that's just what I needed. Works with tmux 2.7.

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