正常模式下libevent和tmux 都只要照著正規的方式
./configure
make
sudo make install
就可以安裝完成並使用,但是在這邊我不是 root 的使用者,也沒有sudo的權限
但是又想自己安裝tmux來玩玩看。
安裝libevent 安裝到 home dir
#cd $HOME/library/installation/folder
#DIR=$HOME/
#./configure --prefix=$DIR
#make
#make install
安裝完後會在home下產生 lib/include/bin 的資料夾
安裝tmux 一樣安裝到home dir 並指定剛剛安裝的 libevent include 和lib路徑
#cd $HOME/program/installation/folder
#DIR=$HOME/
# ./configure --prefix=$DIR CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
#make
#make install
安裝完後即可在bin資料夾下看到tmux的執行檔
執行tmux
#tmux
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
#ldd ~/bin/tmux
libutil.so.1 => /lib64/libutil.so.1 (0x0000003c8fa00000)
libncurses.so.5 => /usr/lib64/libncurses.so.5 (0x0000003c94e00000)
libevent-2.0.so.5 => not found
librt.so.1 => /lib64/librt.so.1 (0x0000003c84000000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003c8ba00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003c82c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003c83400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003c83800000)
/lib64/ld-linux-x86-64.so.2 (0x0000003c81c00000)
會發現找不到libevent的lib路徑,指定一下 LD_LIBRARY_PATH。
#export LD_LIBRARY_PATH=${HOME}/lib/:${LD_LIBRARY_PATH}
libutil.so.1 => /lib64/libutil.so.1 (0x0000003c8fa00000)
libncurses.so.5 => /usr/lib64/libncurses.so.5 (0x0000003c94e00000)
libevent-2.0.so.5 => /home/username/lib/libevent-2.0.so.5 (0x00002b1caf0b6000)
librt.so.1 => /lib64/librt.so.1 (0x0000003c84000000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003c8ba00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003c82c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003c83400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003c83800000)
/lib64/ld-linux-x86-64.so.2 (0x0000003c81c00000)
看起來找到了,執行看看吧!!!
#tmux
(ubuntu 要改 .profile)
如果不想每次新启一個shell都設置LD_LIBRARY_PATH,可以編輯~/.bash_profile文件:
$ vim ~/.bash_profile
添加:
LD_LIBRARY_PATH=${HOME}/lib
export LD_LIBRARY_PATH
(ubuntu 要改 .profile)
如果不想每次新启一個shell都設置LD_LIBRARY_PATH,可以編輯~/.bash_profile文件:
$ vim ~/.bash_profile
添加:
LD_LIBRARY_PATH=${HOME}/lib
export LD_LIBRARY_PATH
沒有留言:
張貼留言
有敘述錯誤或者是觀念有問題歡迎指正