ubuntu
|lib库无法加载
引言
我们在安装或执行某些程序的时候会经常出现类似于“error while loading shared libraries: xxxx.so: cannot open shared object file: No such file or directory ”这样的错误,原因是系统没有安装对应的lib库,只需查找出对应的组件包安装即可。
Ubuntu下处理方法
问题复现
ubuntu18.04在运行Postman的时候,出现错误“./Postman: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory”,提示缺少“libgconf-2.so.4”这个lib组件。
# 首先安装apt-file程序,用来查找"libgconf-2.so.4"属于哪个名
joseph@joseph-ubuntu:~/下载/Postman$ sudo apt install apt-file
#更新缓存
joseph@joseph-ubuntu:~/下载/Postman$ sudo apt update
#"libgconf-2.so.4"文件属于哪个包,在冒号前面的"libgconf-2-4"就是包名称
joseph@joseph-ubuntu:~/下载/Postman$ apt-file search libgconf-2.so.4
#安装对应包
joseph@joseph-ubuntu:~/下载/Postman$ sudo apt install libgconf-2-4
# 再次运行Postman,就不报错了
参考
https://www.qingsword.com/qing/Find-out-package-xxx-so.html