我正在尝试让 virtualbox 在我的 Debian 8.7(64 位架构)机器上运行。
提交 vboxconfig 命令时:
/sbin/vboxconfig
我得到以下回复:
vboxdrv.sh: Building VirtualBox kernel modules.
dpkg-query: no path found matching pattern /lib/modules/3.16.0-042stab116.1/kernel
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:
apt-get install -headers-3.16.0-042stab116.1
(The last command may fail if your system is not fully updated.)
apt-get install -headers
vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
dpkg-query: no path found matching pattern /lib/modules/3.16.0-042stab116.1/kernel
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:
apt-get install -headers-3.16.0-042stab116.1
(The last command may fail if your system is not fully updated.)
apt-get install -headers
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
按照建议,我开始安装头文件(在纠正包名称 headers-3.16.0-042stab116.1 前面的破折号的拼写错误之后):
apt-get install headers-3.16.0-042stab116.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package headers-3.16.0-042stab116.1
E: Couldn't find any package by regex 'headers-3.16.0-042stab116.1'
我的sources.list内容如下:
deb http://ftp.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb http://security.debian.org jessie/updates main contrib non-free
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
deb http://download.virtualbox.org/virtualbox/debian jessie contrib
我假设包含 headers-3.16.0-042stab116.1 的包在存储库中不再可用。因此,我的方法是尝试相应地更新内核,以便我可以安装更新的标头。
我现在的问题是:这是一个 VPS,而不是台式机。
我可以在这样的服务器上进行内核更新吗?如果是这样:我如何找出哪个是要安装的合适的内核映像(apt-cache search linux-image 提供了大量结果)?
干杯
答案1
我相信该包应该是 linux-headers,而不仅仅是标头。
答案2
要在 Debian 中设置正确的构建环境,请使用:
apt install module-assistant m-a prepare
答案3
apt install linux-headers-amd64 build-essential dkms