本文主要是介绍tmux 安装,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
a)ubuntu版本下直接apt-get安装
sudo apt-get install tmux
b)centos7版本下直接yum安装
yum install -y tmux
手动安装:
tmux官网下载地址:http://tmux.github.io/
# yum install libevent libevent-devel ncurses-devel
# tar -zvxf tmux-2.3.tar.gz (提前下载:wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz)
# cd tmux-2.3
# ./configure
# make && make install
1)make编译tmux时,可能出现的错误
control.c: In function ‘control_callback’:
control.c:63: warning: implicit declaration of function ‘evbuffer_readln’
control.c:63: error: ‘EVBUFFER_EOL_LF’ undeclared (first use in this function)
control.c:63: error: (Each undeclared identifier is reported only once
control.c:63: error: for each function it appears in.)
control.c:63: warning: assignment makes pointer from integer without a cast
make: * [control.o] Error 1
原因:使用的libevent的版本太低造成的,tmux1.8要求libevent>= 2.0.10-stable
解决办法:
yumremovelibeventlibevent−devel//先卸载yum安装的libevent y u m r e m o v e l i b e v e n t l i b e v e n t − d e v e l / / 先 卸 载 y u m 安 装 的 l i b e v e n t rpm -qa|grep libevent //确保已经卸载
到http://libevent.org/里面下载最新版的libevent
# tar -zvxf libevent-2.0.21-stable.tar.gz (提前下载:wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz)
# cd libevent-2.0.21-stable
# ./configure
# make && make install
# ll /usr/local/lib/libevent.so **重点内容**
然后再接着make编译tmux就顺利通过了~~
2)运行tmux可能出现的错误:
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
解决办法:建立相应的软链接
32bit系统
# ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
64bit系统
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
或者:
修改LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH
sudo ldconfig
这篇关于tmux 安装的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!