Проблема с получением правильных заголовков Linux для запуска VirtualBox/Vagrant

Я на Ubuntu:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

Версия ядра:

uname -r
5.13.0-23-generic

Проблема в том, что я пытаюсь запустить Vagrant (vagrant up) и получить следующий вывод:

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The reason
is shown below:
 
 VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

Итак , когда я запускаю VBoxManage --version, я получаю:

WARNING: The vboxdrv kernel module is not loaded. Either there is no
 module
        available for the current kernel (5.13.0-23-generic) or it failed to
         load. Please recompile the kernel module and install it by

            sudo /sbin/vboxconfig
 
        You will not be able to start VMs until this problem is fixed.
 6.0.24r139119

Когда я запускаю sudo /sbin/vboxconfigre, я получаю:

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-5.13.0-23-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-5.13.0-23-generic

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

В общем, я заканчиваю предложением запустив ту же команду (/sbin/vboxconfig).

ОБНОВЛЕНИЕ: В соответствии с запросом, вот вывод команды dpkg -l | grep virtualbox

ii  virtualbox-6.0                                  6.0.24-139119~Ubuntu~eoan                                                       amd64        Oracle VM VirtualBox

Итак, поскольку проблема заключается в заголовках Linux, я попытался загрузить заголовки следующим образом:

sudo apt install linux-headers-$(uname -r)

И я получил это:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 linux-headers-5.13.0-23-generic : Depends: libc6 (>= 2.34) but 2.31-0ubuntu9.2 is to be installed
E: Unable to correct problems, you have held broken packages.

Итак, я посмотрел, и оказалось, что для моего версия Версия Linux, я должен запускать заголовки с версией: 5.4.0.91.95или около того

, но вместо этого я запускаю linux-headers-5.13.0-23-genericкоторые, по-видимому, являются заголовками для Linux версии 21.10 (Impish Indri), как это видно по этой ссылке:

https://pkgs.org/download/linux-headers-generic

Итак, каким-то образом я запускаю заголовки для версии 21.10, которая несовместима с libc6 моей фактической версии Linux 20.04.

Я пытался обновить libc6, но Ubuntu предупредил меня, что многие вещи могут пойти не так, как надо, поэтому я не стал этого делать.

Я относительно новичок в Linux, поэтому прошу прощения, если говорю бессмысленные вещи.

Все, что я хочу сделать, это запустить Vagrant, но, похоже, сначала мне нужно разобраться с множеством других вещей. Спасибо вам всем!

0
задан 17 December 2021 в 16:21

0 ответов

Другие вопросы по тегам:

Похожие вопросы: