我之前在我的 Ubuntu 14.10 机器上使用过 VirtualBox,但是最近两个月我没有使用过它。
当我尝试启动虚拟机时,出现以下错误:
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...
,但似乎没有任何反应。
我如何更新已安装的内核来匹配可用的标题或获取旧的标题?
答案1
我发现后就明白了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
。