update-initramfs缺少/lib/modules/4.4.0-13-generic


12

我刚刚升级了linux-firmware软件包,然后使用了,$ sudo update-initramfs -u -k all但是出现了一些错误:

$ 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

我确定我没有内核4.4.0-13。我可能早些时候有过,但是删除了它:

$ 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]

如何解决这些update-initramfs错误?

Answers:


21

该实用程序update-initramfs将查找var/lib/initramfs-tools。您将在那里找到该旧内核的条目。删除它:

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

将摆脱那个错误

(语言环境问题完全是另外一回事...)


2
好的,谢谢你的工作。我sudo locale-gen --purge --no-archive从这个答案中固定了语言环境askubuntu.com/a/100519/56083
piotrekkr

有谁知道在其中创建文件的内容/var/lib/initramfs-tools?什么时候?又为什么呢 我想知道导致问题的原因。
mpb

@mpb afaik,它是由update-initramfs创建的dpkg当内核或驱动程序更新时,它由APT(或?)调用。但是恕我直言,您应该问一个问题
Zanna

@Zanna,我将所有文件移出/var/lib/initramfs-tools,然后运行update-initramfs。它立即退出。我相信它将更新那里已经存在的文件,但是不会创建不存在的文件。此外,它将仅尝试为initrd中已包含文件的内核版本构建 /var/lib/initramfs-tools。如果我足够关心,我会提出一个单独的问题,但是我还有其他工作要做。谢谢!
mpb

没有为我解决。这里同样的问题,但没有旧的内核。
克里斯
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.