Ubuntu 12.04 LTS initramfs-tools 依赖问题

Mik*_*ike 5 upgrade apt dependencies 12.04

我知道这已经被问过好几次了,但每个问题和解决方案似乎都不同。我已经尝试了几乎所有我能想到的方法,但我无法解决这个问题。

我有一个运行 12.04.03 LTS 的 VM(我认为是 VMware),它具有依赖项。VM 在租用的主机上,运行实时系统,所以我不想(进一步)破坏它。

uname -a

Linux support 3.5.0-36-generic #57~precise1-Ubuntu SMP Thu Jun 20 18:21:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

多一点:

sudo apt-get update

[sudo] password for tracker:
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.
 initramfs-tools : Depends: initramfs-tools-bin (< 0.99ubuntu13.1.1~) but 0.99ubuntu13.3 is installed
E: Unmet dependencies. Try using -f.

sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  initramfs-tools
The following packages will be upgraded:
  initramfs-tools
1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
2 not fully installed or removed.
Need to get 0 B/50.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
dpkg: dependency problems prevent configuration of initramfs-tools:
 initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.1.1~); however:
  Version of initramfs-tools-bin on system is 0.99ubuntu13.3.
dpkg: error processing initramfs-tools (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                            dpkg: dependency problems prevent configuration of apparmor:
 apparmor depends on initramfs-tools; however:
  Package initramfs-tools is not configured yet.
dpkg: error processing apparmor (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                            Errors were encountered while processing:
 initramfs-tools
 apparmor
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

如果我查看 initramfs-tools/bin 背后的政策,我会得到:

apt-cache policy initramfs-tools
initramfs-tools:
  Installed: 0.99ubuntu13.1
  Candidate: 0.99ubuntu13.3
  Version table:
     0.99ubuntu13.3 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
 *** 0.99ubuntu13.1 0
        100 /var/lib/dpkg/status
     0.99ubuntu13 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

apt-cache policy initramfs-tools-bin
initramfs-tools-bin:
  Installed: 0.99ubuntu13.3
  Candidate: 0.99ubuntu13.3
  Version table:
 *** 0.99ubuntu13.3 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.99ubuntu13 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)

所以,这个问题似乎是我0.99ubuntu13.3initramfs-tools-bin尚未0.99ubuntu13.1进行initramfs-tools,而不能升级到0.99ubuntu13.3

我已经多次执行 apt-get clean/autoclean/install -f/upgrade -f 但他们不会解决。

我只能想到另外两个“解决方案”:

  1. 编辑 dpkg 依赖项列表,诱使它在依赖项损坏的情况下进行安装。这看起来很狡猾,这将是最后的手段
  2. 从精确/主要来源将 initramfs-tools 和 initramfs-tools-bin 降级到 0.99ubuntu13,并希望这能让它们步调一致。但是,我不确定这是否可行,或者是否会引入更多问题。

我不确定这种情况最初是如何发生的。/boot 已满 96%;它现在已满 56%(它很小 - 64MB ...这是我从托管公司那里得到的)。

任何人都可以提供建议吗?

小智 7

打开以下文件;

sudo gedit /var/lib/dpkg/status
Run Code Online (Sandbox Code Playgroud)

删除所有与 initramfs 相关的条目。

打开突触并删除所有与 initramfs 相关的包。

sudo apt-get update(或在突触中重新加载存储库)

再次尝试安装。