Debian – update-initramfs selects wrong kernel

debianinitramfslinux

I'm running Debian 8 Jessie with kernel 4.1.20 from kernel.org. For some reason when I do update-initramfs -u it tells me the following: /boot/initrd.img-4.4.4 does not exist. Cannot update. For some reason it selects kernel 4.4.4 even though the only kernel I have installed is 4.1.20. When I do an apt-get upgrade and a packages tries to update it it tells me the same thing so I have to manually update it after all the packages get upgraded. I looked in the config but I can't really figure out why it's selecting the wrong kernel.

Best Answer

I ran into the same problem on Xenial by updating it with update-manager. Check /var/lib/initramfs-tools/ to see if it has the wrong kernel version:

$ ls -al /var/lib/initramfs-tools/
insgesamt 20
drwxr-xr-x  2 root root 4096 Sep 28 15:26 .
drwxr-xr-x 62 root root 4096 Sep  3 20:10 ..
-rw-r--r--  1 root root   76 Sep  3 20:38 4.4.0-36-generic
-rw-r--r--  1 root root   76 Sep 28 14:06 4.4.0-38-generic
-rw-r--r--  1 root root   80 Sep 29 14:21 linux-image-4.4.0-22

The last entry was giving me the depmod error; after I removed it, no problems.

Related Question