無root權限安裝tmux

1.先安裝libevent庫,去官網下載對應的庫文件,而後解壓bash

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

2. 安裝tmuxspa

    在安裝的時候須要指定libevent的庫code

    $ 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仍是會報找不到blog

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

    須要將安裝的libevent配置到環境變量裏面去event

    例如:table

    在~/.bashrc裏面寫上 export LD_LIBRARY_PATH=/home/zhiyangh/usr/lib/libevent/lib/:$LD_LIBRARY_PATHclass

 

4.另外爲了不每次啓動terminal後都要手動運行tmux, 能夠在~/.bashrc中增長一行, 這樣就能夠在打開終端時默認啓動tmux: 變量

[[ $TERM != "screen" ]] && exec tmux
相關文章
相關標籤/搜索