Virtual Box “o sistema não está atualmente configurado para construir módulos do kernel” em 16.04 (xenial)

2

Eu tentei instalar a caixa virtual, mas recebo o seguinte erro.

$ sudo /sbin/vboxconfig 
[sudo] password for dude: 
vboxdrv.sh: Building VirtualBox kernel modules.
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 linux-headers-4.4.0-24-generic
(The last command may fail if your system is not fully updated.)
  apt-get install linux-headers-generic
vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
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 linux-headers-4.4.0-24-generic
(The last command may fail if your system is not fully updated.)
  apt-get install linux-headers-generic

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

Meu kernel atual é:

$ uname -r
4.4.0-24-generic

Tentar atualizar os cabeçalhos me fornece o seguinte.

$ sudo apt-get upgrade && sudo apt-get install linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-generic is already the newest version (4.4.0.21.22).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Tentei instalar o linux-headers-4.4.0-24-generic diretamente do deb ainda recebendo erros. Do apt-get eu recebo:

$ sudo apt-get install linux-headers-4.4.0-24-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-4.4.0-24-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.4.0-24-generic' has no installation candidate

Certamente deve haver uma maneira de corrigir isso. Alguma sugestão? Socorro!

    
por Andy Gyawali 17.08.2016 / 05:04

1 resposta

0

A saída de apt-cache policy linux-headers-4.4.0-24-generic que você forneceu foi uma pista importante para a causa raiz desse problema. Como o comando relatou (em parte) Candidate: none ficou claro que os repositórios não foram configurados corretamente em seu sistema e, portanto, não sabia onde encontrar o pacote desejado. Adicione http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main à sua lista de fontes e você poderá instalar o pacote.

Para que você possa verificar o resto da sua lista de fontes, aqui está o meu, para usar como exemplo (removi as linhas comentadas).

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
    
por Organic Marble 19.08.2016 / 18:31