Ubuntu 16.04,当我尝试更新 initramfs(或 apt 更新)时,出现了一些错误。它似乎正在尝试生成一个“新”内核版本,但却引发了错误。有什么方法可以解决这个问题吗?
PC:/boot$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-new
WARNING: missing /lib/modules/new
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed new
dpkg: warning: version 'new' has bad syntax: version number does not start with digit
depmod: ERROR: Bad version passed new
update-initramfs: Generating /boot/initrd.img-4.4.0-23-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-22-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-23-generic
depmod: WARNING: could not open /var/tmp/mkinitramfs_dFsQMd/lib/modules/4.2.0-23-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_dFsQMd/lib/modules/4.2.0-23-generic/modules.builtin: No such file or directory
update-initramfs: Generating /boot/initrd.img-4.2.0-23
WARNING: missing /lib/modules/4.2.0-23
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.2.0-23: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_J6fvxO/lib/modules/4.2.0-23/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_J6fvxO/lib/modules/4.2.0-23/modules.builtin: No such file or directory
答案1
我遇到了类似的问题,我是这样修复的:
sudo update-initramfs -d -k new
这应该会删除虚假的/boot/initrd.img-new
。然后再次尝试您的命令:
sudo update-initramfs -u -k all