Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since running an upgrade today I am no longer able to use apt-get.

Case in point:

sudo apt-get install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up linux-image-3.2.0-24-generic (3.2.0-24.38) ...
Running depmod.
Failed to symbolic-link /boot/initrd.img-3.2.0-24-generic to initrd.img: File exists
dpkg: error processing linux-image-3.2.0-24-generic (--configure):
 subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
 linux-image-3.2.0-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

As far as I can work out, this is what it's failing on:

sudo dpkg --configure linux-image-3.2.0-24-generic
Setting up linux-image-3.2.0-24-generic (3.2.0-24.38) ...
Running depmod.
Failed to symbolic-link /boot/initrd.img-3.2.0-24-generic to initrd.img: File exists
dpkg: error processing linux-image-3.2.0-24-generic (--configure):
 subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
 linux-image-3.2.0-24-generic

However, when I run this everything seems to be working...

/var/lib/dpkg/info/linux-image-3.2.0-24-generic.postinst
echo $?
0

What on earth is going on? I'm a little scared of messing around since I assume this is critical stuff...

share|improve this question
    
I fixed it by uninstalling and installing again. Nothing else worked... – olive May 4 '12 at 14:12
up vote 3 down vote accepted

I removed the initrd symlink from my root directory by running

sudo rm /initrd.img

but if you want to have a failsafe against that you can of course backup the existing initrd.img before deleting it.

Then run

sudo apt-get -f install [package] 

and it should be able to run through successfully.

share|improve this answer
    
The problem occurred again and this time I've taken your solution. :) – olive Jun 1 '12 at 13:23

Try

sudo apt-get -f install [package]

This will force the upgrade. It's worth a try at least. Doing an

sudo apt-get update

can't hurt either.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .