无法安装 wireshark - 加载 xcb 插件失败

无法安装 wireshark - 加载 xcb 插件失败

我已经安装了wireshark 2.2.6:

$ sudo apt install -y wireshark 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wireshark is already the newest version (2.2.6+g32dac6a-1~xenial1).
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic linux-image-4.4.0-72-generic
  linux-image-4.4.0-75-generic linux-image-extra-4.4.0-72-generic linux-image-extra-4.4.0-75-generic snap-confine
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.

我正在运行 ubuntu 16.04,当我尝试启动该应用程序时,我得到:

$ wireshark
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

对我来说,解决这个问题的唯一方法是

sudo QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/ wireshark

但是用户界面看起来很糟糕,比我记忆中的还要糟糕......有没有办法永久解决这个问题?

答案1

正如Qt 论坛,只需将以下代码添加到您的~/.bashrc文件:

export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/appname/libs/Qt/plugins/platforms

替换应用程序名称以您的应用名称命名。应该有一个名为库文件平台文件夹。

答案2

我在使用 Wireshark 2.6.10 时遇到了类似的问题。我想发布我的解决方案,希望它能帮助到其他人。

首先,它抱怨“加载共享库时出错:libdouble-conversion.so.1”。我使用apt install libdouble-conversion1后错误消失了,但被替换为:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

我尝试卸载并重新安装 Wireshark,但无济于事。最后,我卸载了libdouble-conversion1,然后使用apt autoremove。我重新安装了 Wireshark ( apt install wireshark),现在它可以正常工作了。

我认为 libdouble 库肯定已损坏或出了什么问题,当我手动重新安装它时,我使用的包缺少对 Wireshark 很重要的东西。卸载 libdouble 库意味着全新安装 Wireshark 会安装一个包含所需内容的包。

相关内容