系统当前未设置为构建内核模块

系统当前未设置为构建内核模块

当我尝试运行以下命令时

# /sbin/vboxconfig 

我得到了以下

vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-generic linux-headers-4.15.0-34-generic
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-generic linux-headers-4.15.0-34-generic

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

我也尝试了以下

# sudo apt install linux-headers-generic linux-headers-4.15.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-4.15.0-34-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-4.15.0-34-generic' has no installation candidate

我的版本是 16.04

如何解决这个问题?

相关内容