我以前在我的 Ubuntu 14.10 机器上使用过 VirtualBox,但最近两个月我没有使用过它。
当我尝试启动 VM 时,出现以下错误:
WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-generic.
You will not be able to start VMs until this problem is fixed.
我发现其他几个问题说要运行sudo dpkg-reconfigure virtualbox-dkms
或卸载并重新安装 virtualbox。
当我运行这些命令中的任何一个时,我收到以下消息:
------------------------------
Deleting module version: 4.3.18
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-4.3.18 DKMS files...
Building only for 3.13.0-29-generic
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
* Stopping VirtualBox kernel modules [ OK ]
* Starting VirtualBox kernel modules
* No suitable module for running kernel found
[fail]
invoke-rc.d: initscript virtualbox, action "restart" failed.
当我运行时uname -a
,我看到正在运行的内核版本是3.13.0-29-generic
,如上面的消息所述。
但是,当我检查安装了哪些内核标头时,我看到了这些:
linux-headers-3.16.0-24 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-24-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-24-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-25 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-25-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-25-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-26 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-26-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-26-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-28 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-28-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-28-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-29 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-29-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-29-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-30 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-30-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-30-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-31 - Header files related to Linux kernel version 3.16.0
linux-headers-3.16.0-31-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
linux-headers-3.16.0-31-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP
我尝试使用安装3.13.0-29
标头sudo apt-get install linux-headers-`uname -r`
并收到此错误:
Package linux-headers-3.13.0-29-generic is not available...
我尝试运行sudo apt-get dist-upgrade
将内核升级到3.16...
,但它似乎没有做任何事情。
我如何更新已安装的内核以匹配可用的标头或获取旧标头?
在找到https://unix.stackexchange.com/questions/170580/package-linux-headers-3-13-0-27-generic-has-no-installation-candidate并注意到 14.10 应该已经发货后,我想通了从一开始就使用
3.16
内核。这台机器使用 .从 14.04 升级到 14.10
do-release-upgrade
。但是,3.13.x
14.04 的内核是显式安装的,而不是通过linux-image-generic
元数据包安装的,因此它没有升级。但是,标头是使用-generic
元包安装的,因此它们确实得到了更新。安装
linux-generic
导致内核和标头都更新到最新的3.16.x
。