红联Linux门户
Linux帮助

Linux下查找和安装依赖的.so文件

发布时间:2016-05-21 10:39:19来源:linux网站作者:tork_he

以解决Webex在Linux下运行问题为例说明查找和安装依赖的.so文件方法:


查找依赖的.so文件

$ ldd $HOME/.webex/1324/*.so | grep 'not found'
libgtk-x11-2.0.so.0 => not found
libgdk-x11-2.0.so.0 => not found
libXmu.so.6 => not found
libXtst.so.6 => not found
libjawt.so => not found
libjawt.so => not found
libXmu.so.6 => not found
libpangoxft-1.0.so.0 => not found
libXft.so.2 => not found
libpangoft2-1.0.so.0 => not found
libpangox-1.0.so.0 => not found


安装.so查找工具apt-file

sudo apt-get install apt-file
apt-file update


使用apt-file查找.so所在的deb包

$ apt-file search libXmu.so.6
libxmu6: /usr/lib/x86_64-linux-gnu/libXmu.so.6
libxmu6: /usr/lib/x86_64-linux-gnu/libXmu.so.6.2.0
libxmu6-dbg: /usr/lib/debug/usr/lib/x86_64-linux-gnu/libXmu.so.6.2.0


安装对应的数据包

sudo apt-get install -y libgtk2.0-0:i386
sudo apt-get install -y libxmu6:i386
sudo apt-get install -y libgcj14-awt:i386
sudo apt-get install -y libpangoxft-1.0-0:i386
sudo apt-get install -y libxft2:i386
sudo apt-get install -y libpangoft2-1.0-0:i386
sudo apt-get install -y libpangox-1.0-0:i386


ldd命令说明

ldd的作用是打印可执行档依赖的共享库文件。它是glibc的一部分,由Roland McGrath和Ulrich Drepper维护

但是ldd本身不是一个程序,而仅是一个shell脚本:

$ which ldd
/usr/bin/ldd
$ file /usr/bin/ldd
/usr/bin/ldd: Bourne-Again shell script text executable


本文永久更新地址:http://www.linuxdiyf.com/linux/20820.html