Is there unused `initrd.img` to remove?

Solution 1:

"initrd" images will be created each time a package triggers update-initramfs, so it's unlikely that you can find a corresponding package to them.

Use:

dpkg -S /boot/initrd.img*

to see the image has been placed by which package, you should get:

dpkg-query: no path found matching pattern /boot/initrd.img-4...

which means "I can't find any related package to this file", just as I said.


So here is my suggestion,

Remove all "initrd" images:

sudo rm /boot/initrd.img*

Generate new "intird" images for all of your currently installed kernels:

sudo update-initramfs -c -k all

You're done.

Solution 2:

In your case, I think it is ok to remove the initrd.img manually since you clearly do not have a linux-image-4.8.0-34-generic.

For anyone else who comes across this thread and needs to get rid of an "extra" initrd.img, you might have an "extra" linux-image installed which is what update-initramfs is using to generate this "unwanted" initrd.img

So before running sudo rm /boot/initrd.img*, consider running:

sudo apt-get remove linux-image-4.8.0-34-generic

Now run:

sudo update-initramfs -c -k all

I know you already solved your problem, but I thought another person might need quick instructions and might not understand the uniqueness of your problem.

Unless you are VERY sure of what you are doing, do not manually remove system files.

You might need to run sudo update-grub manually afterwards.