在 Ubuntu 16.04 上安装 libqt4-core 时出错

在 Ubuntu 16.04 上安装 libqt4-core 时出错

我正在尝试安装 libqt4-core,但似乎对于依赖项,我有比与此包兼容的版本更新的版本。当我使用时,sudo apt-get install libqt4-core我的输出如下:

Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libqt4-core : Depends: libqt4-dbus (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
               Depends: libqt4-network (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
               Depends: libqt4-script (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
               Depends: libqt4-test (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
               Depends: libqt4-xml (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
               Depends: libqtcore4 (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 is to be installed
E: Unable to correct problems, you have held broken packages.

答案1

从命令行执行此操作

uname -i

如果列出了 x86_64,则说明您拥有 64 位系统,否则为 i386、i586、i686,则说明您拥有 32 位系统。

sudo apt-get update
dpkg --get-selections | grep -i qt

这列出了我的系统上的以下内容

appmenu-qt:amd64                install
appmenu-qt5                 install
libaccounts-qt5-1:amd64             install
libdbusmenu-qt2:amd64               install
libdbusmenu-qt5:amd64               install
libgsettings-qt1:amd64              install
libqt4-dbus:amd64               install
libqt4-dbus:i386                install
libqt4-declarative:amd64            install
libqt4-declarative:i386             install
libqt4-network:amd64                install
libqt4-network:i386             install
libqt4-opengl:i386              install
libqt4-script:amd64             install
libqt4-script:i386              install
libqt4-sql:amd64                install
libqt4-sql:i386                 install
libqt4-sql-mysql:i386               install
libqt4-sql-sqlite:amd64             install
libqt4-xml:amd64                install
libqt4-xml:i386                 install
libqt4-xmlpatterns:amd64            install
libqt4-xmlpatterns:i386             install
libqt5core5a:amd64              install
libqt5dbus5:amd64               install
libqt5feedback5:amd64               install
libqt5gui5:amd64                install
libqt5multimedia5:amd64             install
libqt5network5:amd64                install
libqt5opengl5:amd64             install
libqt5organizer5:amd64              install
libqt5positioning5:amd64            install
libqt5printsupport5:amd64           install
libqt5qml5:amd64                install
libqt5quick5:amd64              install
libqt5quicktest5:amd64              install
libqt5sql5:amd64                install
libqt5sql5-sqlite:amd64             install
libqt5svg5:amd64                install
libqt5test5:amd64               install
libqt5webkit5:amd64             install
libqt5widgets5:amd64                install
libqt5x11extras5:amd64              install
libqt5xml5:amd64                install
libqtcore4:amd64                install
libqtcore4:i386                 install
libqtdbus4:amd64                install
libqtdbus4:i386                 install
libqtgui4:amd64                 install
libqtgui4:i386                  install
libqtwebkit4:i386               install
libsignon-qt5-1:amd64               install
libunity-action-qt1:amd64           install
oxideqt-codecs-extra:amd64          install
qml-module-qt-labs-folderlistmodel:amd64    install
qml-module-qt-labs-settings:amd64       install
qml-module-qtfeedback:amd64         install
qml-module-qtgraphicaleffects:amd64     install
qml-module-qtquick-layouts:amd64        install
qml-module-qtquick-window2:amd64        install
qml-module-qtquick2:amd64           install
qml-module-qttest:amd64             install
qml-module-qtwebkit:amd64           install
qt-at-spi:amd64                 install
qt-at-spi:i386                  install
qtchooser                   install
qtcore4-l10n                    install
qtdeclarative5-accounts-plugin:amd64        install
qtdeclarative5-dev-tools            install
qtdeclarative5-qtquick2-plugin:amd64        install
qtdeclarative5-test-plugin:amd64        install
qtdeclarative5-ubuntu-ui-toolkit-plugin     install
qtdeclarative5-unity-action-plugin:amd64    install
qttranslations5-l10n                install
sni-qt:amd64    

从此列表中,您需要的包是

sudo apt-get install libqtcore4

相关内容