加载共享库时出错:libQt5Network.so.5:

加载共享库时出错:libQt5Network.so.5:

我正在 Ubuntu 18.04 上安装 GNU Octave(从终端)。安装后,当我尝试使用桌面图标启动 Octave 时,它​​无法打开。因此,我尝试从终端启动,结果出现了以下信息

/usr/lib/x86_64-linux-gnu/octave/4.2.2/exec/x86_64-pc-linux-gnu/octave-gui:
error while loading shared libraries:
libQt5Network.so.5: cannot open shared object file: No such file or directory

我尝试卸载/重新安装sudo apt-get remove octave并在重新启动后再次安装,但问题仍然存在。

我甚至尝试过

sudo apt-get update && sudo apt-get install libqt5network5

但结果是

libqt5network5 is already the newest version (5.9.5+dfsg-0ubuntu1)

我很困惑,no such file or directory尽管相关软件包已经安装

我对此并不完全确定,但当我第一次安装 Octave 时,它​​说将使用大约 300+ MB 的数据。我打开电脑安装 Octave,安装完成后才回来。发现这个问题后,我卸载并重新安装了 Octave,但当我重新安装时,它说将使用 4,664 kB。

由于我在安装过程中离开了电脑,所以当我返回查看安装是否完成时,我相信电脑会返回到登录屏幕。这是否可能损坏了库?

$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  python3-distupgrade ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 139 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 ubuntu-release-upgrader-gtk all 1:18.04.22 [9,364 B]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 ubuntu-release-upgrader-core all 1:18.04.22 [24.4 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python3-distupgrade all 1:18.04.22 [105 kB]
Fetched 139 kB in 3s (52.8 kB/s)              
(Reading database ... 199458 files and directories currently installed.)
Preparing to unpack .../ubuntu-release-upgrader-gtk_1%3a18.04.22_all.deb ...
Unpacking ubuntu-release-upgrader-gtk (1:18.04.22) over (1:18.04.21) ...
Preparing to unpack .../ubuntu-release-upgrader-core_1%3a18.04.22_all.deb ...
Unpacking ubuntu-release-upgrader-core (1:18.04.22) over (1:18.04.21) ...
Preparing to unpack .../python3-distupgrade_1%3a18.04.22_all.deb ...
Unpacking python3-distupgrade (1:18.04.22) over (1:18.04.21) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up python3-distupgrade (1:18.04.22) ...
Setting up ubuntu-release-upgrader-core (1:18.04.22) ...
Setting up ubuntu-release-upgrader-gtk (1:18.04.22) ...

$ ldd /usr/lib/x86_64-linux-gnu/octave/4.2.2/exec/x86_64-pc-linux-gnu/octave-gui
    libQt5Network.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
    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

$ cat /etc/ld.so.conf /etc/ld.so.conf.d/* and env | grep LD, and ls -l /usr/lib/*/libQt5Network*
include /etc/ld.so.conf.d/*.conf

# libc default configuration
/usr/local/lib
# Multiarch support
/usr/local/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

ls: cannot access '/usr/lib/*/libQt5Network*': No such file or directory

$ sudo apt install --reinstall libqt5network5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 634 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5network5 amd64 5.9.5+dfsg-0ubuntu1 [634 kB]
Fetched 634 kB in 30s (20.8 kB/s)                                              
(Reading database ... 196636 files and directories currently installed.)
Preparing to unpack .../libqt5network5_5.9.5+dfsg-0ubuntu1_amd64.deb ...
Unpacking libqt5network5:amd64 (5.9.5+dfsg-0ubuntu1) over (5.9.5+dfsg-0ubuntu1) ...
Setting up libqt5network5:amd64 (5.9.5+dfsg-0ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

我在使用 libQt5Widgets.so.5 时又遇到了错误,于是我尝试了相同的解决方案,成功了。然后我在使用 libQt5Gui.so.5 时又遇到了错误,于是我尝试了相同的解决方案,成功了。

但后来出现了 libQt5Core.so.5。我尝试了同样的事情,即sudo apt-get update && sudo apt install --reinstall libqt5core5

$ sudo apt-get update && sudo apt install --reinstall libqt5core5
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease                     
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]    
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] 
Hit:5 https://deb.opera.com/opera-stable stable InRelease 
Fetched 247 kB in 3s (82.7 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libqt5core5

$ ldd /usr/lib/x86_64-linux-gnu/octave/4.2.2/exec/x86_64-pc-linux-gnu/octave-gui | grep not
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found
    libQt5Core.so.5 => not found

编辑:经过一番挖掘,我发现重新安装 libqt5core 的命令是sudo apt-get install --reinstall libqt5core5a(我不知道“a”部分)。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
Need to get 2,035 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5core5a amd64 5.9.5+dfsg-0ubuntu1 [2,035 kB]
Fetched 2,035 kB in 19s (105 kB/s)                                             
(Reading database ... 201031 files and directories currently installed.)
Preparing to unpack .../libqt5core5a_5.9.5+dfsg-0ubuntu1_amd64.deb ...
Unpacking libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu1) over (5.9.5+dfsg-0ubuntu1) ...
Setting up libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

安装完成后,我需要安装更多库,即

libdouble-conversion.so.1

您可以使用它来安装

sudo apt-get install --reinstall libdouble-conversion1

然后

libQt5Svg.so.5

使用安装

sudo apt-get install --reinstall libqt5svg5

我想这部分修复了问题,但仍然没有解决。我现在可以使用以下命令打开 Octave 的 CLI 界面,/usr/bin/octave-cli或者octave-cli

但是当我简单地从终端运行 octave 时,我收到一个错误

octave exited with signal 6

我还无法使用桌面图标或应用程序菜单中的图标打开 Octave。

编辑:由于我尝试了很多方法都无法解决问题,所以我决定重新安装我的 Ubuntu 分区。我毫不费力就解决了所有问题。我猜可能是网速太慢导致我第一次安装 Ubuntu 时失败了,因为我遇到的共享库问题在其他基于 KDE 的软件包(如 kile 和 okular)中也很常见。重新安装解决了问题,所以我建议那些需要备份数据较少的人也这样做。

相关内容