13

I just upgraded linux-firmware package and after that I used $ sudo update-initramfs -u -k all but I got some errors:

$ sudo update-initramfs -u -k all
[sudo] password for piotrek: 
update-initramfs: Generating /boot/initrd.img-4.4.0-34-generic
Warning: No support for locale: en_US.utf8
update-initramfs: Generating /boot/initrd.img-4.4.0-31-generic
Warning: No support for locale: en_US.utf8
update-initramfs: Generating /boot/initrd.img-4.4.0-13-generic
WARNING: missing /lib/modules/4.4.0-13-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-13-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Warning: No support for locale: en_US.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_LJbkti/lib/modules/4.4.0-13-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_LJbkti/lib/modules/4.4.0-13-generic/modules.builtin: No such file or directory

I'm sure I don't have kernel 4.4.0-13. I might have had it some time ago but removed it:

$ apt list --installed | grep linux-

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-base/xenial,xenial,now 4.0ubuntu1 all [installed,automatic]
linux-firmware/now 1.159 all [installed,local]
linux-headers-4.4.0-31/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.4.0-31.50 all [installed]
linux-headers-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed]
linux-headers-4.4.0-34/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.4.0-34.53 all [installed]
linux-headers-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed]
linux-image-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed]
linux-image-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed]
linux-image-extra-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed]
linux-image-extra-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed]
linux-libc-dev/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed]
linux-sound-base/xenial,xenial,now 1.0.25+dfsg-0ubuntu5 all [installed]
syslinux-common/xenial,xenial,now 3:6.03+dfsg-11ubuntu1 all [installed]
syslinux-legacy/xenial,now 2:3.63+dfsg-2ubuntu8 amd64 [installed]

How to fix those update-initramfs errors?

21

The utility update-initramfs looks in var/lib/initramfs-tools. You will find an entry for that old kernel there. Removing it:

sudo rm /var/lib/initramfs-tools/4.4.0-13-generic

will get rid of that error

(the locale issue is something else entirely...)

7
  • 2
    Ok thank you it worked. And I fixed locale with sudo locale-gen --purge --no-archive from this answer askubuntu.com/a/100519/56083 – piotrekkr Aug 9 '16 at 7:51
  • Does anyone know what creates the files in /var/lib/initramfs-tools? And when? And why? I'd like to know what causes the problem. – mpb Dec 21 '17 at 0:43
  • @mpb afaik, it is created by update-initramfs, which is called by APT (or dpkg?) when a kernel or driver is updated. But imho, you should ask a question about this – Zanna Dec 21 '17 at 10:01
  • @Zanna, I moved all the files out of /var/lib/initramfs-tools, and ran update-initramfs. It immediately exited. I believe it will update files that already exist there, but it will not create files that do not exist. Additionally, it will only attempt to build initrds for kernel versions that already have files in /var/lib/initramfs-tools. If I cared enough, I would post a separate question, but I have other tasks to work on. Thanks! – mpb Dec 22 '17 at 2:31
  • didn't solve it for me. same issue here, but no old kernel. – chris Jun 5 '18 at 22:14
0

I also had the same problem. And I had to, in addition to the actions listed above, also delete all files related to the old kernels from /boot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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