4

I did this setup due to Kernel upgrade bug:

GRUB_DEFAULT = 4

in /etc/default/grub

Than I executed

sudo setup-grub

However, it didn't work out. My desired version is 4.2.0-16-generic, because 4.2.0-18 and 4.2.0-17(which actually isn't listed) doesn't work. In the list, 4.2.0-16 is 4th.

When it didn't work, I tried this:

GRUB_DEFAULT = "Advanced options for Ubuntu>Ubuntu, with Linux 4.2.0-16-generic"

and

sudo setup-grub

however, it still didn't work and opened a not-working version of kernel. Currently I can only access 4.2.0-16 manually through Advanced options for Ubuntu, but I want it to load automaticly. What solution would you reccomend me?

The dpkg --list | grep linux-image outputs:

ii  linux-image-extra-4.2.0-16-generic                          4.2.0-16.19                                amd64        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
ii  linux-image-extra-4.2.0-17-generic                          4.2.0-17.21                                amd64        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
ii  linux-image-extra-4.2.0-18-generic                          4.2.0-18.22                                amd64        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
ii  linux-image-generic                                         4.2.0.18.20                                amd64        Generic Linux kernel image

as a last 4 outputs(only ones for Ubuntu 15.10 which contains Kernel 4.2.0).

4
  • Just a heads up, you confuse whatever setup-grub on your machine is with update-grub, but seem to have found that out by yourself already. To answer your comment: "Why did Canonical provide us with a Kernel package that doesn't wrok and actually harms the computer?" Don't assume such a thing, check that the kernel packages have been installed and initramfs images generated properly with all the modules that your machine needs. If the machine still does not properly boot up then disable the boot splash and note down the information or take a photo and report a bug.
    – LiveWireBT
    Nov 11, 2015 at 19:03
  • I don't understand some stuff. What is boot splash? What is initramfs? Nov 11, 2015 at 19:56
  • Disable boot splash temporarily askubuntu.com/q/5065/40581 – the command to update initramfs manpages.ubuntu.com/manpages/trusty/en/man8/… (sudo update-initramfs -u -k <version> or -k all for all) – more detail about initramfs wiki.ubuntu.com/Initramfs
    – LiveWireBT
    Nov 11, 2015 at 20:25
  • Aww... I don't like anything releated to that stuff... Anything releated to system. Do you know if this bug has been reported and if Ubuntu is fixing it? Nov 12, 2015 at 11:29

3 Answers 3

8

You need to use the IDs of the corresponding submenu and menuentry lines.

Note "Advanced options for Ubuntu" is a submenu, you need to use its ID.

Run grep -E "^\\s*(menuentry|submenu) " /boot/grub/grub.cfg

For example if the output is:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-140-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-140-generic-advanced-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-140-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-140-generic-init-upstart-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-140-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-140-generic-recovery-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-101-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-101-generic-advanced-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-101-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-101-generic-init-upstart-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
        menuentry 'Ubuntu, with Linux 4.4.0-101-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-101-generic-recovery-7da0d9d5-45bc-40e4-b17e-18cff7a59b76' {
menuentry 'Memory test (memtest86+)' {
menuentry 'Memory test (memtest86+, serial console 115200)' {

The correct setting would be:

GRUB_DEFAULT="gnulinux-advanced-7da0d9d5-45bc-40e4-b17e-18cff7a59b76>gnulinux-4.4.0-101-generic-advanced-7da0d9d5-45bc-40e4-b17e-18cff7a59b76"

Note you can also use a 0-based numbering, but do take the submenu entries into account:

GRUB_DEFAULT="1>3"

Don't forget to run update-grub at the end.

5
  1. Take a backup of your current grub.

    sudo cp /etc/default/grub /etc/default/grub.bak

  2. Now, open the file.

    sudo gedit /etc/default/grub

  3. Open another terminal and type:

    cat /boot/grub/grub.cfg | grep 4.2.0-16

    You will see a line like this:

    menuentry 'Ubuntu, with Linux 4.2.0-16-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.2.0-18-generic-advanced-esx5367c-b4ug-19sd-v6j8-ty2hj01ui3kj' {..........

  4. Copy this line & paste it:

EDITED FROM:

GRUB_DEFAULT ="gnulinux-4.2.0-16-generic-advanced-2e2221b2-b6c7-4553-815f-67afdc924a98"

EDITED TO:

GRUB_DEFAULT ="gnulinux-advanced-2e2221b2-b6c7-4553-815f-67afdc924a98>gnulinux-4.2.0-16-generic-advanced-2e2221b2-b6c7-4553-815f-67afdc924a98"

  1. Save the file.

  2. Now, type the command:

    sudo update-grub

17
  • Nop! Didn't work out... gnulinux-4.2.0-16-generic-advanced-2e2221b2-b6c7-4553-815f-67afdc924a98 I pasted this line. I updated grub. But it still leads to not working version. P.S. Why did Canonical provide us with a Kernel package that doesn't wrok and actually harms the computer? Nov 11, 2015 at 13:06
  • I edited the line to above could you please see if it works now, there is text entered till >. Please review and see if it works now.
    – Raphael
    Nov 11, 2015 at 13:08
  • You mean it how? The full lines: menuentry 'Ubuntu, with Linux 4.2.0-16-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.2.0-16-generic-advanced-2e2221b2-b6c7-4553-815f-67afdc924a98' { echo 'Loading Linux 4.2.0-16-generic ...' linux /boot/vmlinuz-4.2.0-16-generic root=UUID=2e2221b2-b6c7-4553-815f-67afdc924a98 ro quiet splash $vt_handoff initrd /boot/initrd.img-4.2.0-16-generic Nov 11, 2015 at 13:12
  • @AdriansNetlis - See the answer now, its been edited.
    – Raphael
    Nov 11, 2015 at 13:16
  • OK! Still nothing...:( Adding > and another copy of line didn't solve it. BTW, is it possible to access latest few boot logs? Maybe they can tell us something? Nov 11, 2015 at 13:23
0

OK! I found the solution. I had to link a PPA to grub-customizer.

sudo add-apt-repository ppa:danielrichter2007/grub-customizer

Than I did:

sudo apt-get update

Next step is

sudo apt-get install grub-customizer

After that I open the grub-customizer through unity dash and select the desired kernel from there and tada!:)

1
  • This does not solve the issue for systems that have no desktop env.
    – Dave
    Aug 29, 2022 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.