利用LD_DEBUG=libs解决找不到文件的问题,通常情况都是在系统路径下没有对应的文件,那么这个命令就能够发现缺少的文件,并且能看到查找的路径
[root@localhost tmux-2.6]# tmux -V
tmux: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory[root@localhost tmux-2.6]# LD_DEBUG=libs tmux -V | grep libevent
54283: find library=libutil.so.1 [0]; searching
54283: search cache=/etc/ld.so.cache
54283: trying file=/lib64/libutil.so.1
54283:
54283: find library=libevent-2.1.so.6 [0]; searching
54283: search cache=/etc/ld.so.cache
54283: search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64 (system search path)
54283: trying file=/lib64/tls/x86_64/libevent-2.1.so.6
54283: trying file=/lib64/tls/libevent-2.1.so.6
54283: trying file=/lib64/x86_64/libevent-2.1.so.6
54283: trying file=/lib64/libevent-2.1.so.6
54283: trying file=/usr/lib64/tls/x86_64/libevent-2.1.so.6
54283: trying file=/usr/lib64/tls/libevent-2.1.so.6
54283: trying file=/usr/lib64/x86_64/libevent-2.1.so.6
54283: trying file=/usr/lib64/libevent-2.1.so.6
54283:
tmux: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
找到缺少的文件位置
[root@localhost tmux-2.6]# ll /usr/local/tmux/lib/libevent-2.1.so.6
lrwxrwxrwx. 1 root root 21 Mar 16 00:05 /usr/local/tmux/lib/libevent-2.1.so.6 -> libevent-2.1.so.6.0.2
做个软连接到系统路径下
[root@localhost tmux-2.6]# ln -s /usr/local/tmux/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
这样就能找到缺少的文件了:
[root@localhost tmux-2.6]# tmux -V
tmux 2.6