[root@localhost lib64]# vim lib.txt
vim: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory
即可看到vi命令在/usr/bin/vim路径
然后使用ldd命令确认这个程序执行需要哪些动态链接库
[root@localhost lib64]# ldd /usr/bin/vim
linux-vdso.so.1 => (0x00007ffd16be5000)
libm.so.6 => /lib64/libm.so.6 (0x00007f24b48c8000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f24b46a0000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f24b4476000)
libacl.so.1 => /lib64/libacl.so.1 (0x00007f24b426d000)
libgpm.so.2 => /lib64/libgpm.so.2 (0x00007f24b4065000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f24b3e61000)
libperl.so => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f24b3c44000)
libc.so.6 => /lib64/libc.so.6 (0x00007f24b3881000)
/lib64/ld-linux-x86-64.so.2 (0x0000559dafa50000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f24b361f000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f24b3419000)
libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f24b31f2000)
然后在别的系统上找下这个文件拷贝过来,加执行权限就可以了
[root@app-server ~]# find / -name libperl.so
/usr/lib64/perl5/CORE/libperl.so
[root@app-server ~]# ll /usr/lib64/perl5/CORE/libperl.so
-rwxr-xr-x. 1 root root 1647272 Aug 3 2017 /usr/lib64/perl5/CORE/libperl.so
[root@localhost lib64]# pwd
/usr/lib64
[root@localhost lib64]# chmod +x libperl.so
然后在运行ldd /usr/bin/vim确认是否找到了so文件
如果找到的话就ok了