天天看點

centos7 如何處理 libQt5Widgets.so.5 問題

今天一同僚發過來一個報錯資訊,提示如下:

error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory

查了幾個部落格分享的解決方法,裝了一些包(例如 libGL libGL-devel)等無果,後來發現了一個 rpm 包的網站 rpm.pbone.net,然後安裝了一個線上rpm包;

開始提示說有依賴:

[root@log ~]# rpm -ivh ftp://mirror.switch.ch/pool/4/mirror/centos/7.4.1708/os/x86_64/Packages/qt5-qtbase-gui-5.6.2-1.el7.x86_64.rpm

擷取ftp://mirror.switch.ch/pool/4/mirror/centos/7.4.1708/os/x86_64/Packages/qt5-qtbase-gui-5.6.2-1.el7.x86_64.rpm

錯誤:依賴檢測失敗:

libQt5Core.so.5()(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5Core.so.5(Qt_5)(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5Core.so.5(Qt_5.6)(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5Core.so.5(Qt_5_PRIVATE_API)(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5DBus.so.5()(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5DBus.so.5(Qt_5)(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5Network.so.5()(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

libQt5Network.so.5(Qt_5)(64bit) 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

qt5-qtbase(x86-64) = 5.6.2-1.el7 被 qt5-qtbase-gui-5.6.2-1.el7.x86_64 需要

然後我安裝了 qt5-qtbase

[root@log ~]# yum install -y qt5-qtbase

安裝完成後,再執行上條rpm安裝時,就OK了

準備中... ################################# [100%]

正在更新/安裝...

1:qt5-qtbase-gui-5.6.2-1.el7 ################################# [100%]

之後再執行指令就不報錯了,

[root@log ~]# /home/arith/sources/PredictConsole

PredictConsole v0.9, 2017

Usage:

PredictConsole inFileSale inFileWeather startPredictDay lenth outFile dir

  • -inFileSale: An absolute file path of history sale data.
  • -inFileWeather: An absolute file path of history Weather data.

    -startDay: The day start to predict, should early than max date in inFileData. in string type like '2017/1/1'. Default value is 0.

    -lenth: The disired lenth of predicting days, in UINT type. Default value is 7.

    -outFile: An absolute file path of destination predict result, in String type. Default value is 'result+time.csv'.

    -dir: Optional. An absolute directory path which includes the /data subdir, in String type. Default value is './'.

-- 2018-04-23 --

今天安裝的時候出現了不一樣的問題。

[root@iZwz9chwdyqnsgcy638aafZ ~]# rpm -ivh ftp://mirror.switch.ch/pool/4/mirror/centos/7.4.1708/os/x86_64/Packages/qt5-qtbase-gui-5.6.2-1.el7.x86_64.rpm

Retrieving ftp://mirror.switch.ch/pool/4/mirror/centos/7.4.1708/os/x86_64/Packages/qt5-qtbase-gui-5.6.2-1.el7.x86_64.rpm

error: Failed dependencies:

libEGL.so.1()(64bit) is needed by qt5-qtbase-gui-5.6.2-1.el7.x86_64

libxcb-icccm.so.4()(64bit) is needed by qt5-qtbase-gui-5.6.2-1.el7.x86_64

libxcb-render-util.so.0()(64bit) is needed by qt5-qtbase-gui-5.6.2-1.el7.x86_64

後來直接使用 yum install -y qt5-qtbase-gui 安裝解決的。。。

具體分析待後續類似情況跟進..

繼續閱讀