apt 找不到头文件:linux-image-unsigned-6.5.0-060500-generic

apt 找不到头文件:linux-image-unsigned-6.5.0-060500-generic

当我使用 运行任何程序时apt,它都会提示我安装缺少的头文件。例如,运行sudo apt updgrade会产生:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... 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.
Do you want to continue? [Y/n] y
Setting up linux-image-unsigned-6.5.0-060500-generic (6.5.0-060500.202308271831) ...
Processing triggers for linux-image-unsigned-6.5.0-060500-generic (6.5.0-060500.202308271831) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.5.0-060500-generic
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Error! Your kernel headers for kernel 6.5.0-060500-generic cannot be found at /lib/modules/6.5.0-060500-generic/build or /lib/modules/6.5.0-060500-generic/source.
Please install the linux-headers-6.5.0-060500-generic package or use the --kernelsourcedir option to tell DKMS where it's located.
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Error! Your kernel headers for kernel 6.5.0-060500-generic cannot be found at /lib/modules/6.5.0-060500-generic/build or /lib/modules/6.5.0-060500-generic/source.
Please install the linux-headers-6.5.0-060500-generic package or use the --kernelsourcedir option to tell DKMS where it's located.
dkms autoinstall on 6.5.0-060500-generic/x86_64 failed for evdi(1) virtualbox(1)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
 * dkms: autoinstall for kernel 6.5.0-060500-generic
   ...fail!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-unsigned-6.5.0-060500-generic (--configure):
 installed linux-image-unsigned-6.5.0-060500-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-unsigned-6.5.0-060500-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

我认为当我尝试强制机器升级到 Linux 内核 6.5.6 时,我可能部分安装了不合适的内核。

机器规格:

OS: Ubuntu 23.04 x86_64 
Host: HP EliteBook 850 G8 Notebook PC 
Kernel: 6.2.0-1014-lowlatency 
Uptime: 8 mins 
Packages: 4942 (dpkg), 9 (snap) 
Shell: zsh 5.9 
Resolution: 1920x1080 
DE: GNOME 44.3 
WM: Mutter 
WM Theme: Adwaita 
Theme: Yaru-blue [GTK2/3] 
Icons: Yaru-blue [GTK2/3] 
Terminal: gnome-terminal 
CPU: 11th Gen Intel i7-1185G7 (8) @ 4.800GHz 
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
Memory: 2959MiB / 31771MiB 

如果我尝试运行sudo apt autoremove它会遇到错误处理linux-image-unsigned-6.5.5-060505-generic

Refer to previous errors for more information.
 * dkms: autoinstall for kernel 6.5.6-060506-generic
   ...fail!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-unsigned-6.5.6-060506-generic (--conf
igure):
 installed linux-image-unsigned-6.5.6-060506-generic package post-installation s
cript subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-unsigned-6.5.5-060505-generic
 linux-image-unsigned-6.5.0-060500-generic
 linux-image-unsigned-6.5.6-060506-generic

相关内容