我该如何修复一些损坏的 PyQt 包?

我该如何修复一些损坏的 PyQt 包?

我正在尝试安装 PyQt,但遇到了一些困难(例如无法更新软件包等)。我对 Ubuntu 不太熟悉,所以需要一些帮助。这是我从终端获得的输出:

sudo apt-get install python-qt4
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:
 python-qt4 : Depends: libqt4-declarative (>= 4:4.7.0~rc1) but it is not going to be installed
              Depends: libqt4-designer (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-help (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-script (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-scripttools (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-svg (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-test (>= 4:4.7.0) but it is not going to be installed
              Depends: libqt4-xmlpatterns (>= 4:4.7.0) but it is not going to be installed
E: Broken packages

答案1

它无法安装但 python-qt4,因为在存储库中找不到 libqt4* 包。
我猜你缺少一个规范存储库,所以请启动软件源及以下Ubuntu 软件选项卡确保其设置类似于:

在此处输入图片描述

更改设置后,请确保运行sudo apt-get update。然后您就可以重试安装。

答案2

您是否刷新了存储库?如果没有,请尝试:sudo apt-get update然后再次尝试安装。

如果您的系统存在一些损坏的软件包问题,您也可以尝试以下命令:sudo apt-get check

答案3

我很确定使用

sudo apt-get 更新

进而

sudo apt-get 安装 -f

就可以了。

答案4

终端:gksudo nautilus

导航到 /var/lib/dpkg/info 删除损坏的软件包 libqt4

导航到 /var/lib/dpkg/status 并执行相同操作。(注意:右侧是查找包的搜索选项)

关闭鹦鹉螺。

重要的: sudo apt-get update

         sudo apt-get upgrade

相关内容