I have Ubuntu 18.04.
While launching virtual box I am getting an error
$ virtualbox
VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/lib/virtualbox/VirtualBox.so",) failed: libQt5Core.so.5: cannot open shared object file: No such file or directory
$ ldd /usr/lib/virtualbox/VirtualBox.so | grep Qt
libQt5X11Extras.so.5 => /usr/lib/x86_64-linux-gnu/libQt5X11Extras.so.5 (0x00007f7dcec8e000)
libQt5Core.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5PrintSupport.so.5 => /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007f7dcea1f000)
libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f7dce7c8000)
libQt5Gui.so.5 => not found
libQt5Core.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Core.so.5 => not found
libQt5Widgets.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Core.so.5 => not found
$ apt-file search libQt5Gui.so.5
libqt5gui5: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
libqt5gui5: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.9
libqt5gui5: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.9.5
The system has libqt5* packages but I cannot list some of them using
$ ls /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
ls: cannot access '/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5': No such file or directory
How can I fix this?
For me, the
libqt5gui5
package was already installed. I tried reinstalling like in the other answer, but still got the error:I found a similar problem at https://github.com/dnschneid/crouton/wiki/Fix-error-while-loading-shared-libraries:-libQt5Core.so.5
I'm actually running Debian testing (bullseye) 3.12-1-amd64. The path to my library is
/usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
so the command in my case isAfter that, I was able to get the app (Electrum) working
For all the "not found" libraries, identify their package as you have done with apt-file search for libQt5Gui.so.5. Then install the packages with sudo apt-get install,for example:
The installation of the packages should put the libraries in the proper location so they will be found.
If files are not present, either they were installed in the wrong place (manually forced somewhere), they are the wrong architecture (i386 instead of amd64, so would be in /usr/lib/i386-linux-gnu), or the installation did not run properly (check the status of the packages with the command:
The properly installed packages will have status "ii".
You could use the locate command to find the file(s) if they are somewhere else on the system, but if you installed them, that possibility is not likely.
Try reinstall all libqt5 packages. It helped me in similar case:
After reinstalling
ldd $(which qbittorrent)
displayed all library .so files in their places.Installed dependency to fix this issue.
You might want to run
sudo apt --fix-broken install
to correct these errors: