无法修复损坏的包装系统

无法修复损坏的包装系统

在我(痛苦地)设法在我的 Ubuntu 12.04 LTS 上安装 Skype 之后,几个月前我遇到了一个无法修复的软件包问题。

请查看我的上一篇文章以了解导致此问题的原因:在 Ubuntu 12.04 LTS 64 位上安装 Skype

如果我尝试安装系统更新,更新管理器会意外关闭,提示包装系统损坏并引发以下错误:

The following packages have unmet dependencies:

grub-efi-amd64: Depends: grub2-common (= 1.99-21ubuntu3.9) but 1.99-21ubuntu3.10 is installed
                Depends: grub-efi-amd64-bin (= 1.99-21ubuntu3.9) but 1.99-21ubuntu3.10 is installed

如果我运行sudo apt-get -f install以修复潜在的软件包问题,我会得到以下结果:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-image-3.5.0-26-generic linux-headers-3.5.0-26
  linux-headers-3.5.0-26-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  grub-efi-amd64
The following packages will be upgraded:
  grub-efi-amd64
1 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
2 not fully installed or removed.
Need to get 39.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main grub-efi-amd64 amd64 1.99-21ubuntu3.10 [39.5 kB]
Fetched 39.5 kB in 0s (154 kB/s)        
dpkg: dependency problems prevent configuration of grub-efi-amd64:
 grub-efi-amd64 depends on grub2-common (= 1.99-21ubuntu3.9); however:
  Version of grub2-common on system is 1.99-21ubuntu3.10.
 grub-efi-amd64 depends on grub-efi-amd64-bin (= 1.99-21ubuntu3.9); however:
  Version of grub-efi-amd64-bin on system is 1.99-21ubuntu3.10.
dpkg: error processing grub-efi-amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 (>= 1.99-21ubuntu3.5); however:
  Package grub-efi-amd64 is not configured yet.
dpkg: error processing grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfiguredNo apport report written because the error message indicates its a followup error from a previous failure.
                                                                     No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:
 grub-efi-amd64
 grub-efi-amd64-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我跑步sudo dpkg --configure -a我会得到:

dpkg: dependency problems prevent configuration of grub-efi-amd64:
 grub-efi-amd64 depends on grub2-common (= 1.99-21ubuntu3.9); however:
  Version of grub2-common on system is 1.99-21ubuntu3.10.
 grub-efi-amd64 depends on grub-efi-amd64-bin (= 1.99-21ubuntu3.9); however:
  Version of grub-efi-amd64-bin on system is 1.99-21ubuntu3.10.
dpkg: error processing grub-efi-amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 (>= 1.99-21ubuntu3.5); however:
  Package grub-efi-amd64 is not configured yet.
dpkg: error processing grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-efi-amd64
 grub-efi-amd64-signed

我的理解是,根本原因是未满足软件包的依赖关系grub-efi-amd64grub-efi-amd64-signed因此我尝试了这里描述的方法添加 PPA 后如何解决未满足的依赖关系?但问题仍然存在。

我不确定删除冲突的软件包是否能解决问题,但我还没有这样做,因为我担心这会毁掉我的系统,因为它有 EFI 启动,而我使用 GRUB 启动它。出于同样的原因,我没有尝试运行sudo apt-get -u dist-upgrade,因为也许冲突的软件包可以自动删除。

我想知道其他人是否有过类似的经历以及可能的解决方案。

正如附加信息一样,这是输出gedit /etc/apt/sources.list

# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/main/binary-i386/

# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ dists/precise/restricted/binary-i386/
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130213)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.

deb http://archive.ubuntu.com/ubuntu precise-security main restricted
deb http://archive.ubuntu.com/ubuntu precise-security universe
deb http://archive.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu precise main
# deb-src http://extras.ubuntu.com/ubuntu precise main
deb http://archive.canonical.com/ precise partner
deb-src http://archive.canonical.com/ precise partner

并且gedit /etc/apt/sources.list.d/*(不同的文件):

deb-src http://ppa.launchpad.net/cassou/emacs/ubuntu precise main

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/chrome/deb/ stable main

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/chrome/deb/ stable main

deb http://ppa.launchpad.net/guilhem-fr/swftools/ubuntu precise main
deb-src http://ppa.launchpad.net/guilhem-fr/swftools/ubuntu precise main

deb-src http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu precise main

deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main

deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main

答案1

我最终通过使用 Synaptic 删除有问题的软件包 grub-efi-amd64 和 grub-efi-amd64-signed 解决了我的问题。

之后,我安装并应用了所有待处理的系统更新,这些更新似乎再次安装了提到的软件包。

所有更新过程完成后,我重新启动了系统,现在一切都正常。

答案2

简单安装 synaptic 包管理器,在状态下(左侧)单击损坏的包 - 选择这些包并修复或重新安装它们。

相关内容