1.先安装libevent库,去官网下载对应的库文件,然后解压

 $ cd libevent-2.1.11-stable
 $ ./configure --prefix=/home/zhiyangh/usr/lib/libevent
 $ make && make install

2. 安装tmux

    在安装的时候需要指定libevent的库

    $ LIBEVENT_PATH=/home/zhiyangh/usr/lib/libevent
    $ ./configure --prefix=/home/zhiyangh/usr/lib/tmux CFLAGS="-I$LIBEVENT_PATH/include" LDFLAGS="-L$LIBEVENT_PATH/lib"
    $  make && make install

3. 这个时候去tmux安装目录下运行./tmux还是会报找不到

    ./tmux: error while loading shared libraries: libevent-2.1.so.7: cannot open shared object file: No such file or directory

    需要将安装的libevent配置到环境变量里面去

    例如:

    在~/.bashrc里面写上 export LD_LIBRARY_PATH=/home/zhiyangh/usr/lib/libevent/lib/:$LD_LIBRARY_PATH

 

4.另外为了避免每次启动terminal后都要手动运行tmux, 可以在~/.bashrc中增加一行, 这样就可以在打开终端时默认启动tmux: 

[[ $TERM != "screen" ]] && exec tmux

相关文章:

  • 2021-08-29
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-07-10
  • 2021-10-12
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2021-10-29
  • 2021-09-24
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2021-10-23
  • 2021-11-26
相关资源
相似解决方案