由于依赖性和配置问题导致内核安装失败导致apt和dpkg失败

Modified on: Sat, 09 Jun 2018 16:38:23 +0800

我见过一些类似的问题,但我见过的都没有解决我的问题。在Ubuntu 12.04上从linux-image-3.2.0-36-genericlinux-image-3.2.0-38-generic进行内核升级时发生错误。使用3.2.0-38启动时,引导时会发生内核严重错误。

在“3.2.0-36”下启动,系统正常启动。但是,当我尝试删除干净或配置受影响的内核包时,它会引发以下错误:

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~) but 0.99ubuntu13.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

尝试sudo apt-get -f install,在软件包retrevial​​之后没有成功引用依赖项和配置问题:

dpkg: dependency problems prevent configuration of initramfs-tools:
 initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.1~); however:
  Version of initramfs-tools-bin on system is 0.99ubuntu13.1.
dpkg: error processing initramfs-tools (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-3.2.0-38-generic:
 linux-image-3.2.0-38-generic depends on initramfs-tools (>= 0.36ubuntu6); however:
  Package initramfs-tools is not configured yet.
dpkg: error processing linux-image-3.2.0-38-generic (--configure):
 dependency problems - leaving unconfigured
No 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.
                                                    dpkg: dependency problems prevent configuration of casper:
 casper depends on initramfs-tools (>= 0.92bubuntu55); however:
  Package initramfs-tools is not configured yet.
dpkg: error processing casper (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 initramfs-tools
 linux-image-3.2.0-38-generic
 casper
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行dpkg -- configure -aapt-get -f dist-upgradeapt-get -f autoremove

关于内核升级期间究竟损坏的内容以及如何在不使用Apt-get或Dpkg的情况下回滚内核版本的任何想法?

最佳答案

从这个问题中恢复的过程是暂时删除所有有问题的包:

 dpkg --force-depends --purge <packages> 

然后使用

修复缺少的依赖项

apt-get install -f

确保您的系统不在3.2.0-38内核上运行

uname -r 

然后我建议做一个:

dpkg --force-depends --purge linux*3.2.0-38*
apt-get install -f

相关问答

添加新评论