Installing tmux

Posted on Tuesday, December 16, 2014




I love GNU screen and have used it for years.  But, I have been told I need to start using tmux (it's GNU screen's newer better cousin).  I recently had an excuse to explore it more at work.  I needed to ssh into 8 boxes and tail a log file one each.  I would like to, with one command line command, open a screen that is split into 8 split screens each ssh'n into its given box and tailing a file.  I think tmux can do this, If GNU screen can do it in one command I don't know what that command would be?



Installing tmux in OS X


I have brew installed in OSX using this its easy to install tmux with the following command.


     > brew install tmux


Then checking the version



     > tmux -V


Which seems to be the latest according to http://tmux.sourceforge.net/  [1]

Installing tmux on Ubuntu 12.04


In Ubuntu run


     > sudo apt-get install tmux


Then checking the version


     > tmux -V


In Ubuntu 14.04 I get version 1.8



In Ubuntu 10.04 it seems to be version 1.1

I'd rather have version 1.9a on Ubuntu …

I'm going to give a shot at building it from the github repo code.  https://github.com/ThomasAdam/tmux  [2] is the official github repo.   (I was unsure of this before but Thomas Adam posted a message on this page to correct me.  Its good to know I can rely on the github being up to date)


First remove the current install


     > sudo apt-get remove tmux


Then run the following (this worked for Ubuntu 14.04 but not 10.04)



     > sudo apt-get install automake pkg-config libevent-dev ncurses-dev
     > git clone git://git.code.sf.net/p/tmux/tmux-code tmux
     > cd tmux
     > git checkout tags/1.9a
     > sh autogen.sh
     > ./configure --prefix=/usr
     >  make
     >  sudo make install


Check the tmux version


     > tmux -V






Installing tmux on Ubuntu 10.04


It took a few tries but here's how I got tmux 1.9a to install on Ubuntu 10.04

First you need to install libevent manually http://jtskarbek.wordpress.com/2013/03/22/tmux-compile-failure/ [3]



     > wget http://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
     > tar xf libevent-2.0.21-stable.tar.gz
     > cd libevent-2.0.21-stable
     > ./configure
     > make
     > sudo make install


Then run the following


     > sudo apt-get install automake  pkg-config ncurses-dev
     > sudo apt-get install git-core
     > git clone git://git.code.sf.net/p/tmux/tmux-code tmux
     > cd tmux
     > git checkout tags/1.9a
     > sh autogen.sh
     > ./configure --prefix=/usr
     >  make
     >  sudo make install



Check the tmux version


     > tmux -V








Installing tmux on Ubuntu 12.04



Run the following to install tmux 1.9a on Ubuntu 12.04


     > sudo apt-get install automake pkg-config libevent-dev ncurses-dev build-essential libtool
     > git clone git://git.code.sf.net/p/tmux/tmux-code tmux
     > cd tmux
     > git checkout tags/1.9a
     > sh autogen.sh
     > ./configure --prefix=/usr
     >  make
     >  sudo make install



Check the tmux version


     > tmux -V







Installing tmux on Cygwin


I found this site http://java.ociweb.com/mark/programming/tmuxInCygwin.html  [4] detailing how to install tmux on cygwin.   I used this site a lot in getting my install to work. 


First run Cygwin setup.  In my case setup-x86_64.exe

Make sure



Gcc, git, automake, and pkg-config are installed, if not install them

For gcc I have the following checked

In Devel




In Libs




For git.  You could get it in the Devel section.




I however installed it manually a while ago using a procedure I documented here http://www.whiteboardcoder.com/2014/08/installing-git-v19-on-cygwin-and-ubuntu.html


For Automake checkbox in Devel



Automake: Wrapper and Automake 1.9
For pgk-config.  Checkbox it in Devel




After you select the packages to install



Click Next



Let Cygwinn Setup do its magic.  Then Click Finish


Run the following to install tmux 1.9a on Cygwin

First you need to install libevent manually http://jtskarbek.wordpress.com/2013/03/22/tmux-compile-failure/ [3]


     > wget http://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
     > tar xf libevent-2.0.21-stable.tar.gz
     > cd libevent-2.0.21-stable
     > ./configure --prefix=/usr
     > make
     > make install


Ncurses custom install


     > cd
     > wget http://ftp.gnu.org/gnu/ncurses/ncurses-5.7.tar.gz
     > tar xf ncurses-5.7.tar.gz
     > cd ncurses-5.7
     > ./configure --prefix=/usr
     > make
     > make install



Then run the following


     > cd
     > git clone git://git.code.sf.net/p/tmux/tmux-code tmux
     > cd tmux
     > git checkout tags/1.9a
     > sh autogen.sh
     > ./configure --prefix=/usr
     >  make
     >  make install



Check the tmux version


     > tmux -V






Good I got all the installs working!
References
[1]        tmux sourceforge page
                        http://tmux.sourceforge.net/
                Accessed 12/2014
[2]        github repo
                        https://github.com/ThomasAdam/tmux
                Accessed 12/2014
[3]        tmux compile failure
                        http://jtskarbek.wordpress.com/2013/03/22/tmux-compile-failure/
                Accessed 12/2014 










This post is a part of and epic, the Tmux epic.


Epic Goal:   Learn how to use tmux to open 8 panes that each start to tail a different serverlog via ssh, all via a script.

1 comment:

  1. Thanks for the information. I updated the document to say it was the official git repo. Thanks for all the hard work keeping them all in sync.

    ReplyDelete