linux-image-generic 似乎已损坏

linux-image-generic 似乎已损坏

我正在使用 Ubuntu 12.04。最近我无法再安装任何东西。我总是收到以下错误消息:

Setting up linux-image-3.2.0-34-generic (3.2.0-34.53) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Use of chdir('') or chdir(undef) as chdir() is deprecated at /var/lib/dpkg/inf/linux-image-3.2.0-34-generic.postinst line 235.
Failed to symbolic-link /boot/initrd.img-3.2.0-34-generic to initrd.img:File exists at /var/lib/dpkg/info/linux-image-3.2.0-34-generic.postinst line 614.
dpkg: error processing linux-image-3.2.0-34-generic (--configure):
 subprocess installed post-installation script returned error exit status 17
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-34-generic; however:
  Package linux-image-3.2.0-34-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.2.0.34.37); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up dselect (1.16.1.2ubuntu7) ...
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.
Errors were encountered while processing:
 linux-image-3.2.0-34-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

的输出dpkg -C为:

The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure menu option in dselect for them to work:
 linux-image-generic  Generic Linux kernel image
 linux-generic        Complete Generic Linux kernel

The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect:
 linux-image-3.2.0-34-generic Linux kernel image for version 3.2.0 on 32 bit x8

dpkg --configure linux-image-3.2.0-34-generic linux-image-generic linux-generic结果出现以下错误消息:

Setting up linux-image-3.2.0-34-generic (3.2.0-34.53) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Use of chdir('') or chdir(undef) as chdir() is deprecated at /var/lib/dpkg/inf/linux-image-3.2.0-34-generic.postinst line 235.
Failed to symbolic-link /boot/initrd.img-3.2.0-34-generic to initrd.img:File exists at /var/lib/dpkg/info/linux-image-3.2.0-34-generic.postinst line 614.
dpkg: error processing linux-image-3.2.0-34-generic (--configure):
 subprocess installed post-installation script returned error exit status 17
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-34-generic; however:
  Package linux-image-3.2.0-34-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.2.0.34.37); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.2.0-34-generic
 linux-image-generic
 linux-generic

如果有人能帮助我解决这个问题我会非常高兴!

答案1

不知何故,您有一个伪造的pwd(打印工作目录)命令。我查看了 postinst 脚本中引用的行。它试图通过将的输出存储pwd在变量中来“保存”工作目录,然后在引用的行上,在其他目录中执行一些操作后切换回此目录。问题发生的原因是pwd调用的不知何故有空输出。

运行命令which pwd。如果输出不是/bin/pwd,请找出原因并进行修复。

相关内容