2

Today I upgraded by 14.10 VM to 15.04. Since it's a virtual machine (via VirtualBox), I needed to install guest additions. However, the installation fails saying (in /var/log/vboxadd-install.log):

Error! Your kernel headers for kernel 3.16.0-31-generic cannot be found.

So, I tried to install it in the usual way and got:

Package linux-headers-3.16.0-31-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[.]

Having installed linux-headers-generic, which should provide the correct headers, I was confused. This is the sort of error I would expect if 3.16.0-31 was out of date. But . . . indeed dpkg -l | grep generic produces:

...
ii linux-headers-3.19.0-17-generic ...
...

A ha! So it looks like the guest additions are trying to use an outdated kernel. Maybe they use uname. So I tried uname -r and got:

3.16.0-31-generic


My guess is that the guest additions are using uname to get the desired kernel header version, but that uname is giving the incorrect value for whatever reason. Question: If my analysis is right, how do I fix it? If not, what's the problem?


EDIT: After looking around, it seems that this means the running kernel is actually 3.16.0-31, while 3.19.0-17 is merely installed. I sudo update-grubd, confirmed that 3.19 kernel is the 0th element of /boot/grub/menu.lst and rebooted, but it doesn't seem to change anything.

EDIT: While /boot/grub/menu.lst is correct (the 0th entry is 3.19), on reboot and holding Shift to get the manual menu, I do not see the 3.19 kernel, and the top entry is the 3.16 kernel.

geometrian
  • 225
  • 3
  • 9
  • `uname` probably (technically) isn't giving you the wrong value; That's saying that you're running kernel version 3.16 and not 3.19. Have you restarted the VM since the upgrade? – saiarcot895 May 15 '15 at 02:32
  • @saiarcot895 While I had rebooted, I just figured that and some other things out. See edit. – geometrian May 15 '15 at 02:36
  • Do you have a display attached to the VM, from which you can see the boot, or are you SSH'ing in? If the latter, you could try getting rid of `linux-image-3.16.0-31-generic` and `linux-image-extra-3.16.0-31-generic`. That way, your VM will be forced to boot the latest kernel. – saiarcot895 May 15 '15 at 02:40
  • Also, make sure that the corresponding packages for 3.19.0-17 _are_ installed; you don't want to be left with an unbootable VM. – saiarcot895 May 15 '15 at 02:41
  • @saiarcot895 see 2nd edit. GrUB doesn't seem to be recognizing the 3.19 kernel on bootup at all, even though `update-grub` can _after_ booting into 3.16. I already tried purging/reinstalling grub to no avail. – geometrian May 15 '15 at 02:56
  • @saiarcot895 I have forked it [into a separate question](http://askubuntu.com/questions/623922/why-cant-grub-find-a-kernel-that-it-already-found). – geometrian May 15 '15 at 05:21

2 Answers2

2

It looks like upgrade process from 14.10 to 15.04 has a bug. Kernel does not install correctly. This can be fixed by running:

sudo apt-get install linux-generic

This will pull both linux-image-generic and linux-headers-generic.

These meta packages always point to the latest kernel image and headers.

This is not the first question with this kind of a problem.

Pilot6
  • 88,764
  • 91
  • 205
  • 313
0

fixed mine with:

uname -r
3.13.0-30-generic

sudo apt-get update
sudo apt-get dist-upgrade
reboot

uname -r
3.13.0-30-generic

??

sudo apt-get install linux-image-generic
sudo reboot

uname -r
3.19.0-18-generic

followed by:

sudo /etc/init.d/vboxdrv setup