Skip to content

Instantly share code, notes, and snippets.

@todgru

todgru/_readme.md

Forked from shime/_readme.md
Last active Dec 6, 2020
Embed
What would you like to do?
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="1.8"
libevent_version="2.0.21"
tmux_name="tmux-$tmux_version"
libevent_name="libevent-$libevent_version-stable"
# set the installation directory
target_dir="~/local/bin"
# 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 http://sourceforge.net/projects/tmux/files/tmux/$tmux_name/$tmux_name.tar.gz/download
wget -O $libevent_name.tar.gz https://github.com/downloads/libevent/libevent/$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 $target_dir/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
@victoria

This comment has been minimized.

Copy link

@victoria victoria commented Dec 29, 2014

Saved me a ton of time; thanks!!

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