Skip to content

Instantly share code, notes, and snippets.

@Falkor
Forked from j3j3k/install-tmux.sh
Last active December 23, 2020 18:00
Show Gist options
  • Select an option

  • Save Falkor/386827cf00ae94e52a0a759521fa3525 to your computer and use it in GitHub Desktop.

Select an option

Save Falkor/386827cf00ae94e52a0a759521fa3525 to your computer and use it in GitHub Desktop.

Revisions

  1. Sebastien Varrette revised this gist Dec 23, 2020. 1 changed file with 81 additions and 17 deletions.
    98 changes: 81 additions & 17 deletions install-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,90 @@
    # Install tmux 2.8 on Centos
    #! /bin/bash -l
    # Time-stamp: <Wed 2020-12-23 18:59 svarrette>
    ############################################################################
    # Install tmux 2.9a on Centos
    # Adapted from https://gist.github.com/j3j3k/2378f8e7bca7bcda7ffab16b6b97a328

    CMD_PREFIX=

    TMUX_VERSION=2.9a
    LIBEVENT_VERSION=2.1.10-stable

    STOWDIR=${STOWDIR:=$HOME/stow}

    ################################################################################
    print_error_and_exit() { echo "*** ERROR *** $*"; exit 1; }
    usage() {
    cat <<EOF
    NAME
    $(basename $0):Build and install using stow tmux version ${TMUX_VERSION}
    USAGE
    $0 [-n]
    $0 [-n] --clean
    OPTIONS:
    -n --dry-run: Dry run mode
    --clean: cleanup and remove build/install files
    EOF
    }
    cleanup() {
    for n in tmux-${TMUX_VERSION} libevent-${LIBEVENT_VERSION} ; do
    [ -f "${n}.tar.gz" ] && ${CMD_PREFIX} rm -f ${n}.tar.gz
    if [ -d "${STOWDIR}/${n}" ]; then
    ${CMD_PREFIX} stow -d ${STOWDIR} -D ${n}
    ${CMD_PREFIX} rm -rf ${STOWDIR}/${n}
    ${CMD_PREFIX} rm -rf ${n}
    fi
    done
    }
    ################################################################################
    # Check for options
    while [ $# -ge 1 ]; do
    case $1 in
    -h | --help) usage; exit 0;;
    -n | --noop | --dry-run) CMD_PREFIX=echo;;
    -c | --clean) cleanup; exit 0;;
    *) TMUX_VERSION=$*; break;;
    esac
    shift
    done
    # install deps
    yum install gcc kernel-devel make ncurses-devel
    # yum install gcc kernel-devel make ncurses-devel stow

    # Prepare Stow
    mkdir -p ${STOWDIR} ~/bin ~/include ~/lib


    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz
    tar xf libevent-2.1.10-stable.tar.gz
    cd libevent-2.1.10-stable
    ./configure --prefix=/usr/local
    make
    make install
    echo "==> Download and install libevent ${LIBEVENT_VERSION}"
    [ ! -f "libevent-${LIBEVENT_VERSION}.tar.gz" ] && \
    ${CMD_PREFIX} curl -LOk https://github.com/libevent/libevent/releases/download/release-${LIBEVENT_VERSION}/libevent-${LIBEVENT_VERSION}.tar.gz
    # Build if not yet done
    if [ ! -f "${STOWDIR}/libevent-${LIBEVENT_VERSION}/include/event.h" ]; then
    echo " ... building libevent "
    ${CMD_PREFIX} tar xf libevent-${LIBEVENT_VERSION}.tar.gz
    ${CMD_PREFIX} cd libevent-${LIBEVENT_VERSION}
    ${CMD_PREFIX} ./configure --prefix=${STOWDIR}/libevent-${LIBEVENT_VERSION}
    ${CMD_PREFIX} make
    ${CMD_PREFIX} make install
    fi

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -LOk https://github.com/tmux/tmux/releases/download/2.9a/tmux-2.9a.tar.gz
    tar xf tmux-2.9a.tar.gz
    cd tmux-2.9a
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install
    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    echo "==> Download and install Tmux ${TMUX_VERSION}"
    [ ! -f "tmux-${TMUX_VERSION}.tar.gz" ] && \
    ${CMD_PREFIX} curl -LOk https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
    # Build if not yet done
    if [ ! -f "${STOWDIR}/tmux-${TMUX_VERSION}/bin/tmux" ]; then
    echo " ... building tmux "
    ${CMD_PREFIX} tar xf tmux-${TMUX_VERSION}.tar.gz
    ${CMD_PREFIX} cd tmux-${TMUX_VERSION}
    ${CMD_PREFIX} ./configure --prefix=${STOWDIR}/tmux-${TMUX_VERSION}
    ${CMD_PREFIX} make
    ${CMD_PREFIX} make install
    fi
    echo "=> enable tmux"
    ${CMD_PREFIX} stow -d ${STOWDIR} tmux-${TMUX_VERSION}

    # pkill tmux
    # ${CMD_PREFIX} pkill tmux
    # close your terminal window (flushes cached tmux executable)
    # open new shell and check tmux version
    tmux -V
    ${CMD_PREFIX} tmux -V
  2. @j3j3k j3j3k revised this gist May 28, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions install-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -4,18 +4,18 @@
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
    tar -xf libevent-2.1.8-stable.tar.gz
    cd libevent-2.1.8-stable
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz
    tar xf libevent-2.1.10-stable.tar.gz
    cd libevent-2.1.10-stable
    ./configure --prefix=/usr/local
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -LOk https://github.com/tmux/tmux/releases/download/2.8/tmux-2.8.tar.gz
    tar -xf tmux-2.8.tar.gz
    cd tmux-2.8
    curl -LOk https://github.com/tmux/tmux/releases/download/2.9a/tmux-2.9a.tar.gz
    tar xf tmux-2.9a.tar.gz
    cd tmux-2.9a
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install
  3. @pokev25 pokev25 revised this gist Mar 5, 2019. No changes.
  4. @pokev25 pokev25 revised this gist Mar 5, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install tmux 2.7 on Centos
    # Install tmux 2.8 on Centos

    # install deps
    yum install gcc kernel-devel make ncurses-devel
    @@ -13,9 +13,9 @@ make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -LOk https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
    tar -xf tmux-2.7.tar.gz
    cd tmux-2.7
    curl -LOk https://github.com/tmux/tmux/releases/download/2.8/tmux-2.8.tar.gz
    tar -xf tmux-2.8.tar.gz
    cd tmux-2.8
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install
  5. @pokev25 pokev25 revised this gist Oct 2, 2018. No changes.
  6. @pokev25 pokev25 revised this gist Oct 2, 2018. 1 changed file with 0 additions and 26 deletions.
    26 changes: 0 additions & 26 deletions install_tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +0,0 @@
    # Install tmux 2.7 on Centos release 7

    # install deps
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
    tar -xf libevent-2.1.8-stable.tar.gz
    cd libevent-2.1.8-stable
    ./configure --prefix=/usr/local
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -LOk https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
    tar -xf tmux-2.7.tar.gz
    cd tmux-2.7
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install

    # pkill tmux
    # close your terminal window (flushes cached tmux executable)
    # open new shell and check tmux version
    tmux -V
  7. @pokev25 pokev25 revised this gist Oct 2, 2018. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions install-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    # Install tmux on Centos release 6.5
    # Install tmux 2.7 on Centos

    # install deps
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
    tar -xf libevent-2.0.22-stable.tar.gz
    cd libevent-2.0.22-stable
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
    tar -xf libevent-2.1.8-stable.tar.gz
    cd libevent-2.1.8-stable
    ./configure --prefix=/usr/local
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -OL https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz
    tar -xf tmux-2.3.tar.gz
    cd tmux-2.3
    curl -LOk https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
    tar -xf tmux-2.7.tar.gz
    cd tmux-2.7
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install
  8. @pokev25 pokev25 revised this gist Oct 2, 2018. No changes.
  9. @pokev25 pokev25 revised this gist Oct 2, 2018. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions install_tmux.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Install tmux 2.7 on Centos release 7

    # install deps
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
    tar -xf libevent-2.1.8-stable.tar.gz
    cd libevent-2.1.8-stable
    ./configure --prefix=/usr/local
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL

    curl -LOk https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
    tar -xf tmux-2.7.tar.gz
    cd tmux-2.7
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install

    # pkill tmux
    # close your terminal window (flushes cached tmux executable)
    # open new shell and check tmux version
    tmux -V
  10. @pokev25 pokev25 revised this gist Nov 4, 2016. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions install-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,10 @@ make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    curl -OL https://github.com/tmux/tmux/releases/download/2.2/tmux-2.2.tar.gz
    tar -xf tmux-2.2.tar.gz
    cd tmux-2.2

    curl -OL https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz
    tar -xf tmux-2.3.tar.gz
    cd tmux-2.3
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    make install
  11. @pokev25 pokev25 renamed this gist Oct 19, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  12. @pokev25 pokev25 revised this gist Oct 6, 2016. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions install-tmux
    Original file line number Diff line number Diff line change
    @@ -4,20 +4,20 @@
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    tar -xvzf libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
    tar -xf libevent-2.0.22-stable.tar.gz
    cd libevent-2.0.22-stable
    ./configure --prefix=/usr/local
    make
    sudo make install
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    tar -xvzf tmux-1.9a.tar.gz
    cd tmux-1.9a
    curl -OL https://github.com/tmux/tmux/releases/download/2.2/tmux-2.2.tar.gz
    tar -xf tmux-2.2.tar.gz
    cd tmux-2.2
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    sudo make install
    make install

    # pkill tmux
    # close your terminal window (flushes cached tmux executable)
  13. @rothgar rothgar revised this gist Sep 3, 2014. 2 changed files with 25 additions and 37 deletions.
    37 changes: 0 additions & 37 deletions how_to_install_tmux_on_centos
    Original file line number Diff line number Diff line change
    @@ -1,37 +0,0 @@
    # Install tmux on Centos release 6.5
    # http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
    #

    # READ THIS FIRST!!!
    # MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES
    # yum groupinstall "Development Tools"


    # CD TO TEMPORARY DIRECTORY
    cd /tmp/sources

    # INSTALL NCURSES DEVEL
    yum -y install ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    #### wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    tar -xvzf libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    ./configure
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    #### wget http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    tar -xvzf tmux-1.9a.tar.gz
    cd tmux-1.9a
    ./configure
    make
    make install

    # SWITCH BACK TO REGULAR USER AND EDIT YOUR BASHRC (OR ZSH CONFIG)
    echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bash_profile
    . ~/.bash_profile
    #### source ~/.bash_profile
    25 changes: 25 additions & 0 deletions install-tmux
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # Install tmux on Centos release 6.5

    # install deps
    yum install gcc kernel-devel make ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    tar -xvzf libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    ./configure --prefix=/usr/local
    make
    sudo make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    tar -xvzf tmux-1.9a.tar.gz
    cd tmux-1.9a
    LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
    make
    sudo make install

    # pkill tmux
    # close your terminal window (flushes cached tmux executable)
    # open new shell and check tmux version
    tmux -V
  14. @ekiara ekiara revised this gist Apr 18, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion how_to_install_tmux_on_centos
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,5 @@ make install

    # SWITCH BACK TO REGULAR USER AND EDIT YOUR BASHRC (OR ZSH CONFIG)
    echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bash_profile
    . ~/.bash_profile
    . ~/.bash_profile
    #### source ~/.bash_profile
  15. @ekiara ekiara revised this gist Apr 18, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions how_to_install_tmux_on_centos
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,8 @@ make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    wget http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    #### wget http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    tar -xvzf tmux-1.9a.tar.gz
    cd tmux-1.9a
    ./configure
    @@ -32,4 +33,4 @@ make install

    # SWITCH BACK TO REGULAR USER AND EDIT YOUR BASHRC (OR ZSH CONFIG)
    echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bash_profile
    . ~/.bash_profile
    . ~/.bash_profile
  16. @ekiara ekiara created this gist Apr 18, 2014.
    35 changes: 35 additions & 0 deletions how_to_install_tmux_on_centos
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # Install tmux on Centos release 6.5
    # http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff
    #

    # READ THIS FIRST!!!
    # MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES
    # yum groupinstall "Development Tools"


    # CD TO TEMPORARY DIRECTORY
    cd /tmp/sources

    # INSTALL NCURSES DEVEL
    yum -y install ncurses-devel

    # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
    #### wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    tar -xvzf libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    ./configure
    make
    make install

    # DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
    wget http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
    tar -xvzf tmux-1.9a.tar.gz
    cd tmux-1.9a
    ./configure
    make
    make install

    # SWITCH BACK TO REGULAR USER AND EDIT YOUR BASHRC (OR ZSH CONFIG)
    echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bash_profile
    . ~/.bash_profile