update-initramfs selects wrong kernel

8,985

From the man pages of update-initramfs

-k  version
              Set  the  specific  kernel  version for whom the initramfs will be generated.  For example the output of uname -r for your currently
              running kernel.  This argument is optional for update. The default is the latest kernel version.

              The use of "all" for the version string specifies update-initramfs to execute the chosen action for all kernel  versions,  that  are
              already known to update-initramfs.

So, try to update the initramfs with -k switch

Share:
8,985

Related videos on Youtube

Scoopta
Author by

Scoopta

Updated on September 18, 2022

Comments

  • Scoopta
    Scoopta over 1 year

    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.

  • Scoopta
    Scoopta about 8 years
    That totally works and as I said after an apt-get upgrade finishes I manually update my ramfs by doing just that although that doesn't fix the issue. I don't want to have to update my ramfs after apt fails to do it. I'm looking to have it default to my actual kernel version so apt can automatically update it as needed.
  • Admin
    Admin over 7 years
    This is a really old question and as a result I haven't had this issue in quite a while although not because I fixed it, I still don't know what the issue is. It just kinda stopped at some point when I updated my kernel...however if I ever run into it again I'll check out that directory. Since it does have a file named my kernel version in it I'm hoping that was the issue.
  • Admin
    Admin over 7 years
    Yes, you are right. I read that the post is from august. Sorry
  • Admin
    Admin over 6 years
    I can confirm that this works for me (Ubuntu 16.04)