软件包系统已损坏:无法更新或安装新软件包

软件包系统已损坏:无法更新或安装新软件包

我对 Ubuntu 并不陌生,但我不知道如何处理以下问题:

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
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-declarative : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-designer : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-help : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-opengl : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-qt3support : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-scripttools : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqt4-svg : Depends: libqtgui4 (= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
 libqtgui4 : Depends: libqt4-declarative (= 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1) but 4:4.8.4+dfsg-0ubuntu9.1 is installed
             Depends: libqtcore4 (= 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1) but 4:4.8.4+dfsg-0ubuntu9.1 is installed
             Breaks: libqtgui4:i386 (!= 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1) but 4:4.8.4+dfsg-0ubuntu9.1 is installed
 libqtgui4:i386 : Breaks: libqtgui4 (!= 4:4.8.4+dfsg-0ubuntu9.1) but 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 is installed
E: Unmet dependencies. Try using -f.

我无法更新或安装任何软件包。请帮忙,我该怎么办?

我也尝试过这个:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libqtgui4
Suggested packages:
  qt4-qtconfig
The following packages will be upgraded:
  libqtgui4
1 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.
5 not fully installed or removed.
Need to get 0 B/3.992 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 336705 files and directories currently installed.)
Preparing to replace libqtgui4:amd64 4:4.8.4+dfsg-0ubuntu9.1~ubuntu13.04~ppa1 (using .../libqtgui4_4%3a4.8.4+dfsg-0ubuntu9.1_amd64.deb) ...
Unpacking replacement libqtgui4:amd64 ...
dpkg: error processing /var/cache/apt/archives/libqtgui4_4%3a4.8.4+dfsg-0ubuntu9.1_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libqtgui4/LGPL_EXCEPTION.txt', which is different from other instances of package libqtgui4:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/libqtgui4_4%3a4.8.4+dfsg-0ubuntu9.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

Ubuntu 会告诉你该怎么做,运行“apt-get -f install”来纠正这些问题

然后,在命令提示符中输入 sudo apt-get update,这将仅将包管理器更新为最新包。成功后,您应该可以执行:sudo apt-get upgrade

相关内容