从 13.10 升级到 14.04 后,尝试运行 LibreOffice 时出现此错误。
~$> libreoffice --writer
/usr/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libtasn1.so.3: cannot open shared object file: No such file or directory
该问题不仅仅与 libreoffice 有关,还与更多程序有关。
/usr/lib/chromium-browser/chromium-browser: error while loading shared libraries: libtasn1.so.3: cannot open shared object file: No such file or directory
strace 的输出
~$> strace filezilla
...
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/x86_64/libtasn1.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffc19f9310) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libtasn1.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7fffc19f9310) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libtasn1.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7fffc19f9310) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libtasn1.so.3", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0
...
writev(2, [{"filezilla", 9}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libtasn1.so.3", 13}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {"\n", 1}], 10filezilla: error while loading shared libraries: libtasn1.so.3: cannot open shared object file: No such file or directory) = 122
exit_group(127)
答案1
libtasn1.3 库从 Trusty (14.04) 版本开始,已替换为 libtasn1.6。由于某种原因,您没有安装/使用新库。使用以下命令验证是否已安装:
sudo apt-get install libtasn1-6
如果这不起作用,也升级你的软件包:
sudo apt-get update
sudo apt-upgrade
答案2
解决方案:删除文件/etc/ld.so.conf.d/testlib.conf
。
这个问题是我去年测试一些 Gnome 开发时引起的。
开发环境已设置一个/opt/testlib/
文件夹,其中包含旧版本的libgnutls26
。该/opt/testlib/
文件夹被指向/etc/ld.so.conf.d/testlib.conf
。
在分析了日志中的所有 open(...) 调用后,我发现了问题strace
。
帮助 strace-log:
~$> strace filezilla
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libtinyxml.so.2.6.2", O_RDONLY|O_CLOEXEC) = 3
open("/opt/testlib/lib/libgnutls.so.26", O_RDONLY|O_CLOEXEC) = 3
...
谢谢大家的帮助。
答案3
您可以通过安装 libtasn1-3 来解决这个问题。这是 Trusty 中的过渡包,您可以使用以下命令安装它:
sudo apt-get update
sudo apt-get install libtasn1-3-bin