Linux无root用户安装tmux

依赖库

1.libevent
2.ncurses
3.tmux

libevent安装

wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xvzf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=$HOME/.local --disable-shared
make
make install

ncurses安装

wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
tar -xvzf ncurses-6.0.tar.gz
cd ncurses-6.0
./configure --prefix=$HOME/.local --disable-shared
make
make install

直接从官网的源码编译时,提示报错:
gcc -DHAVE_CONFIG_H -I. -I…/include -D_GNU_SOURCE -DNDEBUG -O2 --param max-inline-insns-single=1200 -c …/ncurses/lib_gen.c -o …/objects/lib_gen.o
In file included from ./curses.priv.h:325:0,
from …/ncurses/lib_gen.c:19:
_18018.c:843:15: error: expected ‘)’ before ‘int’
…/include/curses.h:1631:56: note: in definition of macro ‘mouse_trafo’
#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
^
Makefile:967: recipe for target ‘…/objects/lib_gen.o’ failed
make[1]: *** […/objects/lib_gen.o] Error 1
make[1]: Leaving directory ‘/home/abuu/project/ncurses-6.0/ncurses’
Makefile:113: recipe for target ‘all’ failed
make: *** [all] Error 2
改错:
可使用find命令找到include/curses.h文件:

find .. -name 'curses.h' -print

将include/curses.h中包含mouse_trafo “*/* generated /”注释,重新make即可。

tmux安装

#tmux
wget https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a.tar.gz
tar -xvzf tmux-3.0a.tar.gz
cd tmux-3.0a
./configure CFLAGS="-I$HOME/tmux_depend/include -I/$HOME/tmux_depend/include/ncurses" LDFLAGS="-L/$HOME/tmux_depend/lib -L/$HOME/tmux_depend/include/ncurses -L/$HOME/tmux_depend/include"
#./configure CFLAGS="-I$HOME/.local/include -I$HOME/.local/include/ncurses" LDFLAGS="-L$HOME/.local/lib -L$HOME/.local/include/ncurses -L$HOME/.local/include" CPPFLAGS="-I$HOME/.local/include -I$HOME/.local/include/ncurses" LDFLAGS="-static -L$HOME/.local/include -L$HOME/.local/include/ncurses -L$HOME/.local/lib" 
make
cp tmux $HOME/.local/bin

#添加环境变量

export PATH="$HOME/.local/bin:$PATH"
source .bashrc

tmux安装完成!

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值