我看到了两个与我的问题类似的问题,但都没有适合我的解决方案。当我尝试从 Ubuntu 存储库安装 VirtualBox 时,生成的程序出现错误:
VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/lib/virtualbox/VirtualBox.so",) failed: libQt5Core.so.5: cannot open shared object file: No such file or directory
我安装了 qt5 core。事实上,由于我一直收到 Qt5 错误,我最终
sudo apt install qt*
这并没有解决我的问题。我甚至尝试从源代码构建 VirtualBox,如下这些说明。当我第一次尝试从源代码构建时,我也在步骤中遇到了 Qt5 错误./configure
。我最终从他们的网站安装了 Qt5 并将构建指向它,如下所示:
./configure --disable-hardening --with-qt-dr=/opt/path/to/Qt
这实际上确实修复了 Qt 错误,但现在该kmk
步骤最终失败了,然后如果我继续按照说明操作,我实际上永远无法获得可行的构建。
我也尝试过直接重新安装 Ubuntu 3 或 4 次,但并没有帮助。这是另一个问题在 Ask Ubuntu 上,解决方案并没有真正帮助我,因为据我所知,我的系统输出的内容与唯一答案的工作系统相同。另一个问题没有答案,并且唯一被评论的建议是sudo apt install -f
我显然已经尝试过但并没有修复我的安装。
要求的编辑:
我尝试过sudo apt install --reinstall libqt5core5a
但仍然出现同样的错误。
输出 apt-cache policy virtualbox-qt libqt5core5a
:
virtualbox-qt:
Installed: 5.2.10-dfsg-6
Candidate: 5.2.10-dfsg-6
Version table:
*** 5.2.10-dfsg-6 500
500 http://us.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages
100 /var/lib/dpkg/status
libqt5core5a:
Installed: 5.9.5+dfsg-0ubuntu1
Candidate: 5.9.5+dfsg-0ubuntu1
Version table:
*** 5.9.5+dfsg-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
我也尝试过直接从 Oracle 网站安装 VirtualBox。安装过程看起来好像正常,但随后又抛出了同样的错误。
输出 file /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.9.5
:
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5: symbolic link to libQt5Core.so.5.9.5
输出 ldd /usr/lib/virtualbox/VirtualBox.so | sort
:
/lib64/ld-linux-x86-64.so.2 (0x00007f7ff093a000)
libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f7fe3f24000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f7fe9c5e000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f7fe52ea000)
libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f7fea9e1000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f7febb26000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7fec86e000)
libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f7feb0c3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7fef306000)
libdouble-conversion.so.1 => not found
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f7fe4860000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7fecc5f000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f7febf7d000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f7fe9e73000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f7fef50a000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f7fec233000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f7fe5f38000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f7fe8c31000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f7fe89e6000)
libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f7fe4a68000)
libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f7fe3cee000)
libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f7fe36a0000)
libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f7fe4453000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f7fe61b9000)
libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f7fe3456000)
libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f7fe69dd000)
libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f7fea540000)
libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f7fea189000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f7fe95f6000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f7fe54ee000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f7fe465c000)
libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f7fe41c6000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f7fe5720000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f7fe50df000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f7fe8586000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f7fe8794000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f7fe9a38000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7fece77000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f7fe8f96000)
libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f7fe9813000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f7fe5c09000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f7fe676b000)
libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f7fe91cc000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7febd5e000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f7feda69000)
libQt5Gui.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Gui.so.5 => not found
libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f7fed5a3000)
libQt5PrintSupport.so.5 => /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007f7fed7fa000)
libQt5Widgets.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5X11Extras.so.5 => /usr/lib/x86_64-linux-gnu/libQt5X11Extras.so.5 (0x00007f7fee1b4000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7fe4ec4000)
libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f7fe3ad8000)
librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f7fe93da000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7feb701000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f7fe4ca9000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f7fe314d000)
libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f7feae59000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7fed215000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f7fe59f6000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f7fe63ed000)
libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f7fe38af000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f7fee6d3000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f7fec66a000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f7fef796000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f7fec464000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f7feea0c000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f7fef9be000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f7feb340000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7feb909000)
linux-vdso.so.1 (0x00007ffce770a000)
VBoxKeyboard.so => /usr/lib/virtualbox/VBoxKeyboard.so (0x00007f7fef0f5000)
VBoxRT.so => /usr/lib/virtualbox/VBoxRT.so (0x00007f7feec1e000)
VBoxXPCOM.so => /usr/lib/virtualbox/VBoxXPCOM.so (0x00007f7fee3b8000)
答案1
我找到了答案。基本上,我必须sudo apt install --reinstall package
对很多不同的软件包进行操作,直到它最终起作用。我真的不知道为什么,但仅仅安装必要的软件包是不够的。我必须安装然后重新安装。就我个人而言,我这样做了:
sudo apt install --reinstall libqt5*
sudo apt install --reinstall libdouble-conversion*
- 然后我收到一个错误,说 xcb 插件没有工作,根据
ldd /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so
我所做的输出: sudo apt install libxcb-xinerama0*
sudo apt install --reinstall libxcb-xinerama0*
然后 VirtualBox 就开始工作了。对于任何读过我关于 gparted 无法工作的评论的人来说,类似的过程也让它启动并运行起来了。这似乎是应该由包管理器处理的事情。