Skip to content

Instantly share code, notes, and snippets.

@todgru
Forked from shime/_readme.md
Last active January 30, 2023 04:14
Show Gist options
  • Save todgru/7854665 to your computer and use it in GitHub Desktop.
Save todgru/7854665 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="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
Copy link

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