dpkg 操作失败:无法运行 depmod,处理 linux-image-generic 时出错

dpkg 操作失败:无法运行 depmod,处理 linux-image-generic 时出错

我的笔记本电脑最近断电了几次,现在每当我尝试执行打包操作时,都会收到以下错误代码。我尝试在论坛上搜索解决方案,但这些解决方案要么需要打包操作,要么没有答案。'uname -r' 告诉我我的内核是 3.11.0-17-generic,但我的内核头似乎显示 3.11.0-18-generic。我尝试启动旧内核版本以尝试修复该问题,但遇到了同样的错误。有人知道我该怎么办吗?

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-3.11.0-18-generic (3.11.0-18.32) ...
Running depmod.
Failed to run depmod
dpkg: error processing linux-image-3.11.0-18-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-extra-3.11.0-18-generic:
linux-image-extra-3.11.0-18-generic depends on linux-image-3.11.0-18-generic; however:
  Package linux-image-3.11.0-18-generic is not configured yet.

dpkg: error processing linux-image-extra-3.11.0-18-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.11.0-18-generic; however:
  Package linux-image-3.11.0-18-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-3.11.0-18-generic; however:
  Package linux-image-extra-3.11.0-18-generic is not configured yet.

dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.11.0.18.19); however:
  Package linux-image-generic is not configured yet.
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.
     No apport report written because MaxReports is reached already

dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.11.0-18-generic
 linux-image-extra-3.11.0-18-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

运行以下命令删除未配置的软件包,

sudo dpkg -P linux-image-3.11.0-18-generic
sudo dpkg -P linux-image-extra-3.11.0-18-generic
sudo dpkg -P linux-image-generic
sudo dpkg -P linux-generic

然后最后运行以下命令来修复软件包依赖关系,

sudo apt-get install -f

相关内容