LoginSignup
4
7

More than 5 years have passed since last update.

tmuxをCentOS6にインストール

Last updated at Posted at 2018-03-26

概要

2016年11月4日のお話。

tmuxをCentOS6にインストールしようと思いますが、折角なので現在の最新版(2.3)をソースインストールすることにします。

作業手順

まずはtmuxのサイトへ行って最新版をダウンロード。
https://tmux.github.io/

左上にあるDownloadでURLをコピってwgetして、とりあえずconfigureしてみます。

$ cd /usr/local/src/
$ mkdir tmux
$ cd tmux
$ wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz
$ tar zxvf tmux-2.3.tar.gz
$ cd tmux-2.3
$ ./configure

configure: error: "libevent not found"

libeventが無いと怒られました。
ふむ、、、ではlibeventをソースインストールしましょう。

やたら見た目がアレなサイトへ行き、Download–Stable releasesからlibevent-2.0.22-stable.tar.gzをダウンロードします。
そして何も考えずにとりあえずconfigureしてみます。

$ cd /usr/local/src/
$ mkdir libevent
$ cd libevent
$ wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
$ tar zxvf libevent-2.0.22-stable.tar.gz
$ cd libevent-2.0.22-stable
$ ./configure

特に問題無さそう。
そのままmakeします、そんなに時間はかかりません。

$ make
# make install

ルートでインストール

そして再度tmuxのconfigureに挑戦します。

$ cd /usr/local/src/tmux/tmux-2.3
$ ./configure

configure: error: "curses or ncurses not found"

今度はcursesかncursesが無いそうだ・・・。
ふむー、ではncurses-develをyumで入れてしまいましょう。

# yum install ncurses-devel

そしてもう一度tmuxのconfigureを!

$ cd /usr/local/src/tmux/tmux-2.3
$ ./configure

今度はうまくいきました!
makeしてインストールします、こちらもそんなに時間はかかりません。

$ make
# make install

これでtmux自体は入りましたが、まだ設定ができていません。
設定ファイルを作って読み込めばOKです。.tmux.confという名前でホーム直下に置けばいいかと思います。

$ vi ~/.tmux.conf

私の場合の設定はこんな感じ。

bind r source-file ~/.tmux.conf \; display-message "Reload Config!!"

set-option -g history-limit 10000
set-option -g status-interval 5

set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M

おしまい。

4
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
7