无法使用 evince 打开 pdf 文件。加载库时出错:libexpat.so.1

无法使用 evince 打开 pdf 文件。加载库时出错:libexpat.so.1

我无法在 Ubuntu 16.04 上使用 evince 打开 pdf 文件。我收到以下错误:

evince:加载共享库时出错:libexpat.so.1:无法从共享对象映射段

我的系统中有上述库,LD_LIBRARY_PATH 也通过符号链接指向它。我还尝试重新安装最新版本的 expat,但徒劳无功。有人能帮我吗?

正如评论中提到的,这里是输出dpkg -S libexpat.so.1

libexpat1:i386: /lib/i386-linux-gnu/libexpat.so.1.6.0
libexpat1:amd64: /lib/x86_64-linux-gnu/libexpat.so.1
libexpat1:amd64: /lib/x86_64-linux-gnu/libexpat.so.1.6.0
libexpat1:i386: /lib/i386-linux-gnu/libexpat.so.1

以下是输出ldd $(which evince)

linux-vdso.so.1 =>  (0x00007ffef43a7000)
libevdocument3.so.4 => /usr/lib/x86_64-linux-gnu/libevdocument3.so.4 (0x00007ff373db9000)
libevview3.so.3 => /usr/lib/x86_64-linux-gnu/libevview3.so.3 (0x00007ff373b63000)
libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007ff373234000)
libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007ff372f59000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007ff372d0d000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007ff372ae8000)
libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007ff3728df000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007ff3725cb000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007ff3723a9000)
libsecret-1.so.0 => /usr/lib/x86_64-linux-gnu/libsecret-1.so.0 (0x00007ff37215a000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007ff371dd2000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007ff371b7f000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff37186e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff371565000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff371348000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff370f7e000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007ff370d7a000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff370b60000)
libgstvideo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0 (0x00007ff3708da000)
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007ff3705b0000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007ff3703a3000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007ff370069000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007ff36fe59000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007ff36fc53000)
libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007ff36fa24000)
libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007ff36f72f000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007ff36f519000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007ff36f2d6000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007ff36f0d3000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007ff36eec8000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007ff36ecbe000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007ff36eabb000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007ff36e8b8000)
libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007ff36e679000)
libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007ff36e471000)
libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007ff36e26f000)
libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007ff36e060000)
libmirclient.so.9 => /usr/lib/x86_64-linux-gnu/libmirclient.so.9 (0x00007ff36ddb9000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ff36dba7000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff36d99f000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007ff36d796000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007ff36d4ee000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff36d244000)
libpng12.so.0 => /usr/lib/x86_64-linux-gnu/libpng12.so.0 (0x00007ff36d01f000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007ff36ce1b000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007ff36cc11000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff36c9ef000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007ff36c7e5000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007ff36c504000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007ff36c2e2000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007ff36c0c7000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff36bebf000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff36bc4f000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff374259000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff36ba4b000)
libgstbase-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0 (0x00007ff36b7e7000)
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007ff36b567000)
libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007ff36b338000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007ff36b0ec000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007ff36ae8e000)
libexpat.so.1 => /usr/lib/x86_64-linux-gnu/libexpat.so.1 (0x00007ff374411000)
libmircommon.so.7 => /usr/lib/x86_64-linux-gnu/libmircommon.so.7 (0x00007ff36ac47000)
libmirprotobuf.so.3 => /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3 (0x00007ff36a9d5000)
libcapnp-0.5.3.so => /usr/lib/x86_64-linux-gnu/libcapnp-0.5.3.so (0x00007ff36a74d000)
libmircore.so.1 => /usr/lib/x86_64-linux-gnu/libmircore.so.1 (0x00007ff36a544000)
libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007ff36a340000)
libprotobuf-lite.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9 (0x00007ff36a10f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff369d83000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff369b6b000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007ff369963000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff36975f000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff369559000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007ff369345000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007ff374387000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007ff36911f000)
libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007ff368f07000)
libkj-0.5.3.so => /usr/lib/x86_64-linux-gnu/libkj-0.5.3.so (0x00007ff368cde000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ff368abc000)

答案1

evince我在加载共享库时遇到了类似的问题libboost_filesystem.so.1.58.0

实际上我有这个库/usr/local/lib/libboost_filesystem.so.1.58.0。但是当我通过运行检查输出时

dpkg -S libboost_system.so.1.58.0

libboost-system1.58.0:amd64: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0

发现没有这个库/usr/lib/x86_64-linux-gnu/。因此只需将共享库复制到目标目录即可,通过

sudo cp /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 /usr/lib/x86_64-linux-gnu/

那么问题就解决了。

答案2

libexpat.so.1库应位于(正如您在和的/lib/x86_64-linux-gnu/libexpat.so.1输出中看到的那样dpkg -S libexpat.so.1packages.ubuntu.com)。

尝试libexpat.so.1删除/usr/lib/x86_64-linux-gnu/libexpat.so.1

sudo rm /usr/lib/x86_64-linux-gnu/libexpat.so.1

然后重新安装它的包

sudo apt-get install --reinstall libexpat1:amd64

最后用有问题的 PDF 文档检查 Evince。


笔记:通常,许多文件和目录都是在 APT(及其实用程序 - dpkgapt/ apt-get)的帮助下从 deb 包安装的,但在这个特殊情况下/usr/lib/x86_64-linux-gnu/libexpat.so.1超出了他们的控制范围,所以我们需要手动将其删除。

相关内容