Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu 12.04. Recently I can't install anything anymore. I always get the following error message:

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)

The output of dpkg -C is:

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

but dpkg --configure linux-image-3.2.0-34-generic linux-image-generic linux-generic results in the following error message:

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

I would be very glad if someone could help me with this problem!

share|improve this question
    
Try rm /initrd.img an run that dpkg --configure again. –  Eric Carvalho Dec 28 '12 at 22:09
    
I tried it but it didn't help, still the same error message. Thank you for the quick answer though! –  nalvory Dec 28 '12 at 23:00
add comment

1 Answer 1

up vote 1 down vote accepted

You have a bogus pwd (print working directory) command, somehow. I took a look at the referenced line in the postinst script. It is trying to "save" the working directory by storing the output of pwd in a variable, and then, on the referenced line, switching back to this directory after doing a few things in other directories. The problem happens because the pwd called somehow has empty output.

Run the command which pwd. If the output isn't /bin/pwd, find out why and fix it.

share|improve this answer
    
pwd seems to work fine and which pwd outputs /bin/pwd as it should. –  nalvory Dec 29 '12 at 12:23
    
I played around with some perl scripts and I noticed that pwd doesn't work from within perl apparently, it just returns an empty string. Running which pwd from within the perl script returns /bin/pwd though. How is this possible? As I said above, running pwd in the terminal works just fine... –  nalvory Dec 29 '12 at 13:42
1  
That's really weird. I'm trying to figure out why that would be, but I'm no perl expert. In any case, I'm fairly certain that it's a bug that the postinst script calls pwd instead of using Perl's own Cwd like it ought to. –  tgies Dec 29 '12 at 13:54
    
I substituted all occurrences of pwd in /var/lib/dpkg/info/linux-image-3.2.0-34-generic.postinst with getcwd() and now everything seems to work again! Thanks a lot, tgies! –  nalvory Dec 29 '12 at 14:40
    
I was going to suggest that as a solution to your immediate problem. It is still a point of concern that pwd isn't working from Perl for you. –  tgies Dec 29 '12 at 14:46
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.