5

After upgrading to 15.04, I need to have kernel headers matching the running kernel (for another package).

The upgrade installed kernel 3.19.0-17. Just in case, I also installed linux-headers-generic. Then, I ran sudo update-grub and rebooted. Yet, the system booted into kernel 3.16.0-31 (as confirmed by uname -r).

After much digging, I found that GrUB recognizes the 3.19 kernel in update-grub and even populates it into /boot/grub/menu.lst. However, on startup, GrUB only recognizes up to the 3.16 kernel in the boot menu. How do I fix this, so that GrUB can boot into 3.19?


Here are some outputs from my current system.

sudo update-grub always produces the following output:

$ sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-3.19.0-17-generic
Found kernel: /boot/vmlinuz-3.16.0-31-generic
Found kernel: /boot/vmlinuz-3.13.0-40-generic
Found kernel: /boot/vmlinuz-3.11.0-19-generic
Found kernel: /boot/vmlinuz-3.8.0-35-generic
Found kernel: /boot/memtest86+.bin
Found kernel: /boot/vmlinuz-3.19.0-17-generic
Found kernel: /boot/vmlinuz-3.16.0-31-generic
Found kernel: /boot/vmlinuz-3.13.0-40-generic
Found kernel: /boot/vmlinuz-3.11.0-19-generic
Found kernel: /boot/vmlinuz-3.8.0-35-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Opening /boot/grub/menu.lst after running update-grub, the very first option is:

title        Ubuntu 15.04, kernel 3.19.0-17-generic
uuid        ac9d0eaf-e090-4c29-8e7b-30e98ed07d29
kernel        /boot/vmlinuz-3.19.0-17-generic root=UUID=ac9d0eaf-e090-4c29-8e7b-30e98ed07d29 ro quiet splash
initrd        /boot/initrd.img-3.19.0-17-generic

But, holding Shift during boot, there is no option to choose 3.19 (although I can choose any of the others). After startup, uname -r confirms it booted into 3.16:

$ uname -r
3.16.0-31-generic

Output cropped from a dpkg -l, showing that the 3.19 kernel is indeed installed:

ii  linux-headers-3.19.0-17                              3.19.0-17.17                               all          Header files related to Linux kernel version 3.19.0
ii  linux-headers-3.19.0-17-generic                      3.19.0-17.17                               amd64        Linux kernel headers for version 3.19.0 on 64 bit x86 SMP
ii  linux-headers-generic                                3.19.0.17.16                               amd64        Generic Linux kernel headers

I have also tried purge/reinstalling grub and the headers, and some other things that amounted to no consequence.

9
  • For grub, the linux-image-* packages are more important than the linux-headers-* packages. May 15, 2015 at 11:41
  • On my system, I don't have a /boot/grub/menu.lst, but instead have a /boot/grub/grub.cfg, which seems to get updated instead. The man page for update-grub suggests that it calls grub-mkconfig, telling it to output the data to /boot/grub/grub.cfg. Do you have a file named /boot/grub/grub.cfg, and does it not have the newer kernel? May 15, 2015 at 11:47
  • @saiarcot895 linux-image-3.19.0-17-generic is also present in the dpkg listing. I do have a grub.cfg file, and it indeed lacks the 3.19 record.
    – geometrian
    May 15, 2015 at 14:26
  • Try removing (make sure you have a back-up) /boot/grub/menu.lst and /boot/grub/default (if the latter exists) and run update-grub again. Check to see if /boot/grub/grub.cfg now contains the 3.19 record. May 15, 2015 at 14:57
  • @saiarcot895 done. It does not.
    – geometrian
    May 15, 2015 at 20:55

1 Answer 1

4

The older version of GRUB (0.9.7) likely used menu.lst to determine what to display, while the newer version of GRUB (GRUB 2) uses grub.cfg instead. It looks like you have some mix of GRUB and GRUB 2 installed.

Using update-grub from the grub package will update the menu.lst file, which will effectively do nothing if the bootloader is GRUB 2, which is what is happening here. Instead, you should install grub2-common (which should uninstall the grub package). Then, when running update-grub (or update-grub2; both do the same thing), the grub.cfg file gets updated instead.

Answer based on this answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .