从 17.10 执行 dist 升级到 18.04 后,texstudio 不再运行。我收到以下错误
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Reinstalling the application may fix this problem.
Aborted (core dumped)
我怀疑问题出在 texstudio 配置上,因为错误第一行末尾的路径是“”。
如果我跑ldd /usr/bin/texstudio
我得到
linux-vdso.so.1 (0x00007ffc1f53d000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f64914f2000)
libquazip5.so.1 => /usr/lib/x86_64-linux-gnu/libquazip5.so.1 (0x00007f64912c4000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f64910a7000)
libhunspell-1.6.so.0 => /usr/lib/x86_64-linux-gnu/libhunspell-1.6.so.0 (0x00007f6490e38000)
libpoppler-qt5.so.1 => /usr/lib/x86_64-linux-gnu/libpoppler-qt5.so.1 (0x00007f6490bbf000)
libQt5PrintSupport.so.5 => /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007f6490950000)
libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f6490109000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f648f9a0000)
libQt5Network.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007f648f614000)
libQt5Xml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007f648f3d8000)
libQt5Script.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Script.so.5 (0x00007f648ef42000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f648e7f7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f648e5d8000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f648e24f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f648deb1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f648dc99000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f648d8a8000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f648d680000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f648d47c000)
libpoppler.so.73 => /usr/lib/x86_64-linux-gnu/libpoppler.so.73 (0x00007f648cfe8000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f648cd5c000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f648cb2a000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f648c88c000)
libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f648c3eb000)
libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f648c034000)
libdouble-conversion.so.1 => /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007f648be23000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f648bb0d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6492612000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f648b909000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f648b703000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f648b44f000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f648b20a000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f648afa2000)
libnss3.so => /usr/lib/x86_64-linux-gnu/libnss3.so (0x00007f648ac5e000)
libsmime3.so => /usr/lib/x86_64-linux-gnu/libsmime3.so (0x00007f648aa32000)
libnspr4.so => /usr/lib/x86_64-linux-gnu/libnspr4.so (0x00007f648a7f5000)
liblcms2.so.2 => /usr/lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007f648a59d000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f648a326000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f648a0f5000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f6489e3f000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f6489c12000)
libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f6488069000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6487df7000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f6487be2000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f64879b0000)
libnssutil3.so => /usr/lib/x86_64-linux-gnu/libnssutil3.so (0x00007f6487781000)
libplc4.so => /usr/lib/x86_64-linux-gnu/libplc4.so (0x00007f648757c000)
libplds4.so => /usr/lib/x86_64-linux-gnu/libplds4.so (0x00007f6487378000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6487170000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6486f4a000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f6486d3c000)
如果我跑qtchooser -print-env
我得到
qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt4/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"
而内容/usr/lib/x86_64-linux-gnu/qtchooser
是
lrwxrwxrwx 1 root root 50 Dec 22 2017 4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Dec 22 2017 5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Dec 22 2017 qt4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Dec 22 2017 qt5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
所以看起来 qt 默认为 qt4 但 texstudio 需要 qt5。所以我
ln -s qt5.conf default.conf
在 /usr/lib/x86_64-linux-gnu/qtchooser 中运行,现在qtchooser -print-env
打印
QT_SELECT="default"
QTTOOLDIR="/usr/lib/qt5/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"
但是,这不能解决问题。Texstudio 仍然无法启动并打印相同的错误消息