Lyx 无法启动。它给我的唯一错误消息是:
lyx: symbol lookup error: lyx: undefined symbol: _ZN17QAbstractItemView11eventFilterEP7QObjectP6QEvent, version Qt_5
两天来 Lyx 一直在折磨我,我快要崩溃了。求求你帮帮我吧。
我正在使用 Ubuntu 20.04.1 LTS
Lyx 版本:lyx/focal,now 2.3.5.2-1~focal~ppa1 amd64
- 安装的 Qt 软件包:
apt list --installed | grep qt
libqt5core5a/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5dbus5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5gui5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5network5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
libqt5svg5/focal,now 5.12.8-0ubuntu1 amd64 [installed,automatic]
libqt5widgets5/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qt5-gtk-platformtheme/focal,now 5.12.8+dfsg-0ubuntu1 amd64 [installed,automatic]
qttranslations5-l10n/focal,focal,now 5.12.8-0ubuntu1 all [installed,automatic]
有人对如何解决这个问题有什么建议吗?
編輯
- 输出
apt-cache policy lyx
lyx:
Installed: 2.3.4.2-2
Candidate: 2.3.4.2-2
Version table:
*** 2.3.4.2-2 500
500 http://br.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status
- 存储库:
grep ^deb -r /etc/apt --include=*.list
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal main restricted
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal-updates main restricted
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal universe
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal-updates universe
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal multiverse
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal-updates multiverse
/etc/apt/sources.list:deb http://br.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu focal-security multiverse
/etc/apt/sources.list.d/google-chrome.list:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/etc/apt/sources.list.d/rock-core-ubuntu-qt4-focal.list:deb http://ppa.launchpad.net/rock-core/qt4/ubuntu focal main
- 输出
dpkg -l | grep ppa
ii apparmor 2.13.3-7ubuntu5.1 amd64 user-space parser utility for AppArmor
ii libapparmor1:amd64 2.13.3-7ubuntu5.1 amd64 changehat AppArmor library
ii ppa-purge 0.2.8+bzr63 all disables a PPA and reverts to official packages
ii printer-driver-pnm2ppa 1.13+nondbs-0ubuntu6 amd64 printer driver for HP-GDI printers
- 输出
dpkg -l | grep -i libQt5Widgets
ii libqt5widgets5:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 widgets module
- 输出
sudo find / -name libQt5Widgets* -type f
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/local/lib/libQt5Widgets.so.5
/usr/local/Wolfram/Mathematica/12.1/SystemFiles/Components/WSMCore/SystemModeler/SystemFiles/Libraries/Linux-x86-64/libQt5Widgets.so.5
/usr/local/Wolfram/Mathematica/12.1/SystemFiles/Libraries/Linux-x86-64/Qt/lib/libQt5Widgets.so.5
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.12.8
/home/lima/.local/share/Trash/info/libQt5Widgets.so.5.10.1.trashinfo
/home/lima/.local/share/Trash/info/libQt5Widgets.so.5.trashinfo
/home/lima/.local/share/Trash/info/libQt5Widgets.so.5.10.trashinfo
/home/lima/.local/share/Trash/info/libQt5Widgets.so.trashinfo
/home/lima/.local/share/Trash/files/libQt5Widgets.so.5
/home/lima/.local/share/Trash/files/l_mkl_2020.3.279/pset/32e/qt/libQt5Widgets.so.5.12.8
- 输出
which lyx
:
/usr/bin/lyx
- 输出
lyx --version
lyx: symbol lookup error: lyx: undefined symbol: _ZN17QAbstractItemView11eventFilterEP7QObjectP6QEvent, version Qt_5
- 输出
ldd $(which lyx)
linux-vdso.so.1 (0x00007ffd600a8000)
libmythes-1.2.so.0 => /lib/x86_64-linux-gnu/libmythes-1.2.so.0 (0x00007ff29c583000)
libenchant-2.so.2 => /lib/x86_64-linux-gnu/libenchant-2.so.2 (0x00007ff29c575000)
libmagic.so.1 => /lib/x86_64-linux-gnu/libmagic.so.1 (0x00007ff29c54d000)
libz.so.1 => /usr/local/lib/libz.so.1 (0x00007ff29c331000)
libQt5Svg.so.5 => /usr/local/lib/libQt5Svg.so.5 (0x00007ff29c2d9000)
libQt5Widgets.so.5 => /usr/local/lib/libQt5Widgets.so.5 (0x00007ff29bc93000)
libQt5Gui.so.5 => /usr/local/lib/libQt5Gui.so.5 (0x00007ff29b6d1000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007ff29b188000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff29afa7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff29ae58000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff29ae3d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff29ac4b000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff29d54d000)
libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007ff29ac43000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007ff29ab1a000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007ff29aaf1000)
libbz2.so.1.0 => /usr/local/lib/libbz2.so.1.0 (0x00007ff29a8dd000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff29a8ba000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007ff29a832000)
libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x00007ff29a5ef000)
libicui18n.so.66 => /lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007ff29a2f0000)
libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007ff29a10a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff29a104000)
libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007ff29a081000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007ff29a069000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff299ff6000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007ff299f3e000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007ff299f0a000)
libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007ff298449000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007ff29830a000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ff2982e0000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007ff2982da000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ff2982d2000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007ff2982b8000)
答案1
您使用本地安装的 Qt5 库破坏了您的系统。
它们来自某些编译,而不是来自 deb 包。
因此,您需要删除此类库,然后 LyX 才能正常工作:
sudo rm /usr/local/lib/libQt5Widgets.so.5
sudo rm /usr/local/lib/libQt5Svg.so.5
sudo rm /usr/local/lib/libQt5Gui.so.5
此外,我建议从中删除其他库,/usr/local/lib
因为它们不受 APT 控制,因此您将遇到以下问题。使用以下命令删除与 LyX 相关的库:
sudo rm /usr/local/lib/libz.so.1
sudo rm /usr/local/lib/libbz2.so.1.0
sudo rm /usr/local/lib/libpng16.so.16
仔细检查/usr/local/lib/
内容可能也会有用。
您必须删除 LyX 的 PPA 以避免 Qt 依赖问题:
sudo apt-get install ppa-purge
sudo ppa-purge ppa:lyx-devel/release
然后重新安装 LyX:
sudo apt-get install --reinstall lyx