web-dev-qa-db-fra.com

Virtual Box "Le système n'est pas actuellement configuré pour construire des modules de noyau" sur 16.04 (xenial)

J'ai essayé d'installer virtual box mais j'obtiens l'erreur suivante.

$ 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.

Mon noyau actuel est:

$ uname -r
4.4.0-24-generic

Essayer de mettre à jour les en-têtes me donne ce qui suit.

$ 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.

Je ai essayé d'installer linux-headers-4.4.0-24-generic directement à partir de deb toujours obtenir des erreurs. D'apt-get je reçois:

$ 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

Il doit sûrement y avoir un moyen de résoudre ce problème. Aucune suggestion? Aidez-moi!

2
Andy Gyawali

Le résultat de apt-cache policy linux-headers-4.4.0-24-generic que vous avez fourni est un indice important de la cause première de ce problème. Depuis que la commande a signalé (en partie) Candidate: none, il était clair que les dépôts n’étaient pas configurés correctement sur votre système et, par conséquent, il ne savait pas où trouver le package souhaité. Ajoutez http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main à votre liste de sources et vous devriez pouvoir installer le paquet.

Pour que vous puissiez vérifier le reste de votre liste de sources, voici à quoi ressemble le mien, à utiliser à titre d'exemple (j'ai supprimé les lignes commentées).

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
0
Organic Marble