一半君的总结纸

听话只听一半君

CentOS 6.4 无root statically compile tmux 1.9a

原因是没权限,用不了yum,也不想sudo装,不然可能会搞挂

dependencies:

  • 安装libevent
    # 一行命令下载同时解压
    curl -L https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | tar xz
    cd libevent-2.0.21-stable
    ./configure --prefix=$HOME/.local
    make
    make install 
    
  • 安装ncurses
    # 换种写法
    curl -O  http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
    tar -xvf ncurses-5.9.tar.gz
    cd ncurses-5.9
    ./configure --prefix=$HOME/.local
    make
    make install 
    

    但是这样装好以后没有.pc文件,所以自己凑一个

    prefix=/home/fucker/.local
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include
    major_version=5
    version=5.9
    
    Name: ncurses
    Description: ncurses 5.9 library
    Version: ${version}
    Requires:
    Conflicts:
    Libs: -L${libdir} -levent
    Libs.private: -lrt 
    Cflags: -I${includedir}
    
  • 安装tmux
    curl -L http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz | tar xz
    cd tmux*
    setenv PKG_CONFIG_PATH=/home/fucker/.local/lib/pkgconfig
    # 想搞成static版本的,这样可以拷给公司其他人用
    ./configure --prefix=$HOME/apps/tmux --enable-static
    make
    make install
    

最后运行的时候有错误提示

> ~/apps/tmux/bin/tmux
protocol version mismatch (client 8, server 7) 

可是我已经关了老版本的啊?
这样乱搞了一下就好了,不知何故

$ pgrep tmux
3429
$ /proc/3429/exe attach

也可以写成一行

/proc/$(pgrep tmux)/exe attach

据说这样也行 ( kill server process )

killall -9 tmux
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: