问题是,每次我尝试安装包时,都会收到一条错误消息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libqt4-test : Breaks: libqt4-test:i386 (!= 4:4.8.1-0ubuntu4.3) but 4:4.8.1-0ubuntu4.2 is to be installed
libqt4-test:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.3 is to be installed
Breaks: libqt4-test (!= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.3 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
然后,当我调用时sudo apt-get -f install
,收到此错误:
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libpgm-5.1-0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libqt4-test:i386
The following packages will be upgraded:
libqt4-test:i386
1 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
2 not fully installed or removed.
Need to get 0 B/61.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: error processing libqt4-test:i386 (--configure):
libqt4-test:i386 4:4.8.1-0ubuntu4.2 cannot be configured because libqt4-test:amd64 is in a different version (4:4.8.1-0ubuntu4.3)
dpkg: error processing libqt4-test (--configure):
libqt4-test:amd64 4:4.8.1-0ubuntu4.3 cannot be configured because libqt4-test:i386 is in a different version (4:4.8.1-0ubuntu4.2)
No apport report written because MaxReports is reached already
Errors were encountered while processing:
libqt4-test:i386
libqt4-test
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人知道我该如何摆脱这一困境吗?
答案1
看起来像是多架构偏差。Apt 可以看到4:4.8.1-0ubuntu4.2
和i386
的版本,但它需要两种架构4:4.8.1-0ubuntu4.3
的amd64
相同版本。
也许您更新的时间真的很糟糕,因为这个包已经构建好了amd64
但i836
还没有构建?
4:4.8.1-0ubuntu4.3
已经为它们两个构建了,因此您应该能够先执行 ,apt-get update
然后再执行apt-get -f install
。
解决方案:
dpkg --force-depends --remove libqt4-test libqt4-test:i386
删除它们,然后重新安装它们apt-get -f install libqt4-test libqt4-test:i386