grub default kernel does not update
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    46
    Posts
    256

    grub default kernel does not update

    After installation of a new kernel, e.g. kernel-4.16.13-200.fc27.x86_64 ...
    Code:
    [root@E7440-DELL boris]# dnf history info 477
    Transaction ID : 477
    Begin time     : Wed 06 Jun 2018 01:53:09 PM CEST
    Begin rpmdb    : 3580:38f530fc3ac572d9a813112d265730199b4ef6c6
    End time       : Wed 06 Jun 2018 01:54:17 PM CEST (68 seconds)
    End rpmdb      : 3580:358fc75598628371df659bc5f52afa99f7ff9905
    User           : Boris Ljevar <boris>
    Return-Code    : Success
    Command Line   : update
    Transaction performed with:
        Installed     dnf-2.7.5-2.fc27.noarch  @updates
        Installed     rpm-4.14.1-1.fc27.x86_64 @updates
    Packages Altered:
        Upgraded hplip-common-3.18.4-2.fc27.x86_64            @updates
        Upgrade               3.18.4-3.fc27.x86_64            @updates
        Upgraded hplip-libs-3.18.4-2.fc27.x86_64              @updates
        Upgrade             3.18.4-3.fc27.x86_64              @updates
        Erase    kernel-4.13.16-100.fc25.x86_64               @updates/25
        Install  kernel-4.16.13-200.fc27.x86_64               @updates
        Erase    kernel-core-4.13.16-100.fc25.x86_64          @updates/25
        Install  kernel-core-4.16.13-200.fc27.x86_64          @updates
        Erase    kernel-debug-devel-4.16.7-100.fc26.x86_64    @updates/26
        Install  kernel-debug-devel-4.16.13-200.fc27.x86_64   @updates
        Upgraded kernel-headers-4.16.12-200.fc27.x86_64       @updates
        Upgrade                 4.16.13-200.fc27.x86_64       @updates
        Erase    kernel-modules-4.13.16-100.fc25.x86_64       @updates/25
        Install  kernel-modules-4.16.13-200.fc27.x86_64       @updates
        Erase    kernel-modules-extra-4.13.16-100.fc25.x86_64 @updates/25
        Install  kernel-modules-extra-4.16.13-200.fc27.x86_64 @updates
        Upgraded libsane-hpaio-3.18.4-2.fc27.x86_64           @updates
        Upgrade                3.18.4-3.fc27.x86_64           @updates
    Scriptlet output:
       1 cat: write error: Broken pipe

    My system still boots the previous kernel, currently 4.16.12-200.fc27.x86_64 ...
    Code:
    [root@E7440-DELL boris]# uname -a
    Linux E7440-DELL 4.16.12-200.fc27.x86_64 #1 SMP Fri May 25 21:10:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    Apparently, no changes were made to GRUB config after installing a new kernel ...
    Code:
    [root@E7440-DELL boris]# grubby --default-kernel
    /boot/vmlinuz-4.16.12-200.fc27.x86_64
    [root@E7440-DELL boris]# grubby --info=ALL
    index=0
    kernel=/boot/vmlinuz-4.16.12-200.fc27.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.16.12-200.fc27.x86_64.img
    title=Fedora (4.16.12-200.fc27.x86_64) 27 (Workstation Edition)
    index=1
    kernel=/boot/vmlinuz-4.16.11-100.fc26.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.16.11-100.fc26.x86_64.img
    title=Fedora (4.16.11-100.fc26.x86_64) 27 (Workstation Edition)
    index=2
    kernel=/boot/vmlinuz-4.13.16-100.fc25.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.13.16-100.fc25.x86_64.img
    title=Fedora (4.13.16-100.fc25.x86_64) 27 (Workstation Edition)
    index=3
    kernel=/boot/vmlinuz-0-rescue-2b19506cad024a8da961a27bc6613d79
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-0-rescue-2b19506cad024a8da961a27bc6613d79.img
    title=Fedora (0-rescue-2b19506cad024a8da961a27bc6613d79) 27 (Workstation Edition)
    index=4
    non linux entry
    index=5
    non linux entry
    index=6
    non linux entry

    In order to fix this, I must always manually rebuild /boot/grub2/grub.cfg as follows:
    Code:
    [root@E7440-DELL grub2]# mv grub.cfg grub.cfg.old
    [root@E7440-DELL grub2]# grub2-mkconfig -o grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.16.13-200.fc27.x86_64
    Found initrd image: /boot/initramfs-4.16.13-200.fc27.x86_64.img
    Found linux image: /boot/vmlinuz-4.16.12-200.fc27.x86_64
    Found initrd image: /boot/initramfs-4.16.12-200.fc27.x86_64.img
    Found linux image: /boot/vmlinuz-4.16.11-100.fc26.x86_64
    Found initrd image: /boot/initramfs-4.16.11-100.fc26.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-2b19506cad024a8da961a27bc6613d79
    Found initrd image: /boot/initramfs-0-rescue-2b19506cad024a8da961a27bc6613d79.img
    Found Windows 7 on /dev/sda2
    done

    After running grub2-mkconfig the GRUB config is updated ...
    Code:
    [root@E7440-DELL grub2]# grubby --default-kernel
    /boot/vmlinuz-4.16.13-200.fc27.x86_64
    [root@E7440-DELL grub2]# grubby --info=ALL
    index=0
    kernel=/boot/vmlinuz-4.16.13-200.fc27.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.16.13-200.fc27.x86_64.img
    title=Fedora (4.16.13-200.fc27.x86_64) 27 (Workstation Edition)
    index=1
    kernel=/boot/vmlinuz-4.16.12-200.fc27.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.16.12-200.fc27.x86_64.img
    title=Fedora (4.16.12-200.fc27.x86_64) 27 (Workstation Edition)
    index=2
    kernel=/boot/vmlinuz-4.16.11-100.fc26.x86_64
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-4.16.11-100.fc26.x86_64.img
    title=Fedora (4.16.11-100.fc26.x86_64) 27 (Workstation Edition)
    index=3
    kernel=/boot/vmlinuz-0-rescue-2b19506cad024a8da961a27bc6613d79
    args="ro radeon.audio=1 rhgb quiet kaslr "
    root=UUID=5b40483e-f637-46d8-bc82-3ee3cad1a9e9
    initrd=/boot/initramfs-0-rescue-2b19506cad024a8da961a27bc6613d79.img
    title=Fedora (0-rescue-2b19506cad024a8da961a27bc6613d79) 27 (Workstation Edition)
    index=4
    non linux entry
    index=5
    non linux entry
    index=6
    non linux entry

    This is not an isolated issue. Ever since the system-upgrade fc25 to fc26, GRUB config suddenly stopped updating. I would prefer not to manually rebuild /boot/grub2/grub.cfg each time a new kernel is installed.
    Is there a way to fix this?
    Last edited by blnlx; 6th June 2018 at 01:41 PM.
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  2. #2
    Join Date
    Sep 2006
    Location
    On up the road a piece
    Posts
    765
    Linux Firefox 60.0

    Re: grub default kernel does not update

    Just to chime in, I'm having the same issue on two machines after I updated them to F28. Every morning I have to switch them on and remember to wait and choose the latest kernel. Otherwise it will boot the previous kernel.
    I live in my own little world, but it's OK, they know me here.

  3. #3
    Join Date
    Dec 2017
    Location
    Sosnowiec, PL
    Age
    36
    Posts
    31
    Linux Firefox 60.0

    Re: grub default kernel does not update

    Could you show output of commands?
    Code:
    cat /etc/default/grub
    Code:
    grub2-editenv list
    Last edited by marcin82; 29th June 2018 at 04:43 PM.
    marcin82

  4. #4
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,333
    Unknown Firefox 60.0

    Re: grub default kernel does not update

    Probably something set wrong in /etc/default/grub

  5. #5
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    1,833
    Linux Pale Moon 27.9.3

    Re: grub default kernel does not update

    Yes ... the "GRUB_DEFAULT" variable in /etc/default/grub can control which kernel to select.
    Here's a quote from the grub2 manual (which may not be the latest):
    ‘GRUB_DEFAULT’
    The default menu entry. This may be a number, in which case it identifies
    the Nth entry in the generated menu counted from zero, or the title of a menu
    entry, or the special string ‘saved’. Using the title may be useful if you want
    to set a menu entry as the default even though there may be a variable number
    of entries before it.
    For example, if you have:
    menuentry ’Example GNU/Linux distribution’ --class gnu-linux {
    ...
    }
    then you can make this the default using:
    GRUB_DEFAULT=’Example GNU/Linux distribution’
    If you set this to ‘saved’, then the default menu entry will be that saved by
    ‘GRUB_SAVEDEFAULT’, grub-set-default, or grub-reboot.
    The default is ‘0’.
    grub2-mkconfig with the correct options has to be run to activate the configs in the /etc/default/grub file. Usually one of:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

  6. #6
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765
    Linux Chrome 67.0.3396.87

    Re: grub default kernel does not update

    Quote Originally Posted by SomeDamFool
    Just to chime in, I'm having the same issue on two machines after I updated them to F28. Every morning I have to switch them on and remember to wait and choose the latest kernel. Otherwise it will boot the previous kernel.
    I recently had this happen to me on F28 after a kernel update. A new kernel came in, but on the next boot session I realized I was still on the previous version kernel.

    For years now, I've been mostly handling grub.cfg file maintenance (other than what grubby does with on kernel updates) with manual editing rather than using the "grub2-mkconfig" route. So I looked at the menu entries in the grub.cfg file and found them not to be in the expected version descending order starting from the top. My solution was edit the file and do a cut and past to put the Fedora kernel menuentry sections in proper order, and to insure the default kernel was "0". Once done, the newest kernel is now the default boot kernel.

    Also, I forced a new rescue kernel by removing the existing F25 rescue kernel entries from /boot, and that was put as the first menu entry in the grub.cfg file and the default was then changed from 0 to 1. I didn't like that, so I ordered it to my liking and put the default back to 0.

    Code:
    $ sudo grep menuentry /boot/efi/EFI/fedora/grub.cfg | cut -s -d "'" -f 2
    Fedora (4.16.16-300.fc28.x86_64) 28 (Twenty Eight)
    Fedora (4.16.15-300.fc28.x86_64) 28 (Twenty Eight)
    Fedora (4.16.14-300.fc28.x86_64) 28 (Twenty Eight)
    Fedora 28 Rescue cb50e8a1e81549e38cee2db87cb98c5b (4.16.16-300.fc28.x86_64)
    Windows Boot Manager (on /dev/sda2)
    Don't fear manually editing your grub.cfg file, as long as you have a thorough understanding of the layout and how it should be.

  7. #7
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    46
    Posts
    256
    Linux (Fedora) Firefox 60.0

    Re: grub default kernel does not update

    Quote Originally Posted by marcin82
    Could you show output of commands?
    Code:
    cat /etc/default/grub
    Code:
    grub-editenv list
    Code:
    [boris@E7440-DELL python]$ cat /etc/default/grub
    GRUB_TIMEOUT=3
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="radeon.audio=1 rhgb quiet kaslr"
    GRUB_DISABLE_RECOVERY="true"
    [boris@E7440-DELL python]$ grub-editenv list
    bash: grub-editenv: command not found...
    [boris@E7440-DELL python]$
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  8. #8
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765
    Linux Chrome 67.0.3396.99

    Re: grub default kernel does not update

    All of the Fedora grub commands use grub2, not just grub.
    Code:
    /usr/bin/grub2-editenv
    /usr/bin/grub2-file
    /usr/bin/grub2-fstest
    /usr/bin/grub2-glue-efi
    /usr/bin/grub2-kbdcomp
    /usr/bin/grub2-menulst2cfg
    /usr/bin/grub2-mkfont
    /usr/bin/grub2-mkimage
    /usr/bin/grub2-mklayout
    /usr/bin/grub2-mknetdir
    /usr/bin/grub2-mkpasswd-pbkdf2
    /usr/bin/grub2-mkrelpath
    /usr/bin/grub2-mkrescue
    /usr/bin/grub2-mkstandalone
    /usr/bin/grub2-render-label
    /usr/bin/grub2-script-check
    /usr/bin/grub2-syslinux2cfg
    /usr/sbin/grub2-bios-setup
    /usr/sbin/grub2-get-kernel-settings
    /usr/sbin/grub2-install
    /usr/sbin/grub2-macbless
    /usr/sbin/grub2-mkconfig
    /usr/sbin/grub2-ofpathname
    /usr/sbin/grub2-probe
    /usr/sbin/grub2-reboot
    /usr/sbin/grub2-rpm-sort
    /usr/sbin/grub2-set-default
    /usr/sbin/grub2-setpassword
    /usr/sbin/grub2-sparc64-setup
    /usr/sbin/grub2-switch-to-blscfg

  9. #9
    Join Date
    Sep 2006
    Location
    On up the road a piece
    Posts
    765
    Linux Firefox 60.0

    Re: grub default kernel does not update

    My desktop boot default was the oldest kernel, and my laptop boot default was the second oldest kernel. On both machines the default in /etc/default/grub was GRUB_DEFAULT=saved. I changed them to GRUB_DEFAULT=0 then ran:
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    Now on both machines the latest kernel is the default. So if it stays that way after the next kernel update I'm in business.

    Edit: After the last kernel update it's back to the previous kernel as default, with /etc/default/grub still reading GRUB_DEFAULT=0. Apparently to make the newest kernel default grub now has to be manually re-configured after each kernel update. :-(
    Last edited by SomeDamFool; 19th July 2018 at 03:06 AM.
    I live in my own little world, but it's OK, they know me here.

  10. #10
    Join Date
    Apr 2005
    Location
    Towanda, PA
    Posts
    19
    Linux (Fedora) Firefox 61.0

    Re: grub default kernel does not update

    I've been lax on dnf update, and just recently ran it and it tried to install kernel-4.17.7, but I'm booting into my last good kernel, 4.16.15. At first I noticed that the /lib/modules didn't have 4.17.7 installed, even though rpm -qa | grep kernel showed the kernel 4.17.7 was there. So i tried dnf remove kernel-4.17.7, it was gone, and then dnf update kernel. This time, the /lib/modules were there, but there was no grub entry. When I looked in /boot, there were no 4.17.7 entries - not even vmlinuz-4.17.7. How can grubby work if the dnf update doesn't even put a copy of 4.17.7 in my /boot? Do I just force it, or is it a sign that something else is wrong? Or should I have installed 4.17.7 instead of updating?

    I see there are plenty of complaints about 4.17.3 on, but this seems different.

    Using xfce with a lot of Gnome utilities.

  11. #11
    PabloTwo's Avatar
    PabloTwo is offline "Registered User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    7,765
    Linux Chrome 68.0.3440.75

    Re: grub default kernel does not update

    I would try,
    Code:
    # dnf reinstall kernel*-4.17.7

  12. #12
    Join Date
    Apr 2005
    Location
    Towanda, PA
    Posts
    19
    Linux (Fedora) Firefox 61.0

    Re: grub default kernel does not update

    Thanks, that seemed to do it. I thought I was doing the same thing in a step-by-step basis so I could watch, but it must have missed some steps.

Similar Threads

  1. Replies: 3
    Last Post: 6th November 2017, 06:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •