18.04 “sudo apt autoremove”导致错误“警告:缺少 /lib/modules/uname”

18.04 “sudo apt autoremove”导致错误“警告:缺少 /lib/modules/uname”

将内核更新至 5.0.0-36-generic 后,在内核更新后安装更新时出现错误。具体来说,该错误似乎是在软件包更新过程中出现的linux-firmware

运行软件更新程序或sudo apt update在终端中显示所有软件包都是最新的。

但是 Synaptic Package Manager 提示linux-firmware尚未完成安装。如果我尝试重新安装,则会收到类似以下错误。

我尝试过sudo apt cleansudo apt autoremove。当我使用 Synaptic 安装软件包时,安装会报告错误,但软件包确实会安装。

计算机启动正常。

18.04 安装在三个主分区中的第二个上/dev/sda2,Ubuntu 16.04 也安装在这个分区上/dev/sda1,并且/dev/sda3是空的。

错误是这样的:

martin@computer:~$ sudo apt autoremove
[sudo] password for martin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-firmware (1.173.12) ...
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
depmod: ERROR: Bad version passed uname
update-initramfs: Generating /boot/initrd.img-uname-r
WARNING: missing /lib/modules/uname-r
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname-r
dpkg: warning: version 'uname-r' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname-r' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname-r' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname-r' has bad syntax: version number does not start with a digit
depmod: ERROR: Bad version passed uname-r
update-initramfs: Generating /boot/initrd.img-uname
WARNING: missing /lib/modules/uname
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: Bad version passed uname
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
dpkg: warning: version 'uname' has bad syntax: version number does not start with a digit
depmod: ERROR: Bad version passed uname
update-initramfs: Generating /boot/initrd.img--r
/usr/sbin/mkinitramfs: option requires an argument -- 'r'
W: non-GNU getopt
update-initramfs: failed for /boot/initrd.img--r with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
E: Sub-process /usr/bin/dpkg returned an error code (1)
martin@computer:~$

18.04 安装中当前有三个内核:

martin@computer:~$ ls -al /boot/
total 179196
drwxr-xr-x  3 root root     4096 Nov 15 22:48 .
drwxr-xr-x 24 root root     4096 Nov 14 20:48 ..
-rw-r--r--  1 root root   217480 Nov 12 09:54 config-4.15.0-70-generic
-rw-r--r--  1 root root   224516 Nov 11 08:44 config-5.0.0-35-generic
-rw-r--r--  1 root root   224516 Nov 12 10:46 config-5.0.0-36-generic
drwxr-xr-x  6 root root     4096 Nov 13 20:50 grub
-rw-r--r--  1 root root 39680508 Nov 13 19:29 initrd.img-4.15.0-70-generic
-rw-r--r--  1 root root 41118914 Nov 13 17:33 initrd.img-5.0.0-35-generic
-rw-r--r--  1 root root 41116325 Nov 15 16:23 initrd.img-5.0.0-36-generic
-rw-r--r--  1 root root 10854263 Nov 15 22:48 initrd.img-uname
-rw-r--r--  1 root root 10854268 Nov 15 22:48 initrd.img-uname-r
-rw-r--r--  1 root root   182704 Jan 28  2016 memtest86+.bin
-rw-r--r--  1 root root   184380 Jan 28  2016 memtest86+.elf
-rw-r--r--  1 root root   184840 Jan 28  2016 memtest86+_multiboot.bin
-rw-------  1 root root  4066166 Nov 12 09:54 System.map-4.15.0-70-generic
-rw-------  1 root root  4301791 Nov 11 08:44 System.map-5.0.0-35-generic
-rw-------  1 root root  4301791 Nov 12 10:46 System.map-5.0.0-36-generic
-rw-------  1 root root  8363672 Nov 12 09:58 vmlinuz-4.15.0-70-generic
-rw-------  1 root root  8785656 Nov 11 08:48 vmlinuz-5.0.0-35-generic
-rw-------  1 root root  8785656 Nov 12 10:47 vmlinuz-5.0.0-36-generic
martin@computer:~$

相关内容