Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    205

    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?
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  2. #2
    Linux User
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    271
    Why is that so bad? It's one command...

    Probably Fedora changed it's package manager to not upgrade GRUB automatically.
    You could create an alias to make it easier. For example, in ~/.bashrc add:
    Code:
    alias grub-updater='sudo mv /boot/grub/grub.cfg /boot/grub/grub.cfg.old && sudo grub2-mkconfig -o /boot/grub/grub.cfg'
    Then after kernel upgrades run
    Code:
    $ grub-updater
    Problem solved.
    Last edited by CarterCox; 06-06-2018 at 03:38 PM.

  3. #3
    Linux User
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    271
    By the way, why do you have all the old kernels? Doesn't RPM remove them after an update?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    205
    Quote Originally Posted by CarterCox View Post
    By the way, why do you have all the old kernels? Doesn't RPM remove them after an update?
    Yes, the old kernels are removed after upgrade, only three last installed are kept.
    Code:
    [root@E7440-DELL boris]# ll /boot/vmlinuz-*
    -rwxr-xr-x. 1 root root 5751144 Jan  5  2016 /boot/vmlinuz-0-rescue-2b19506cad024a8da961a27bc6613d79
    -rwxr-xr-x. 1 root root 8302776 May 22 22:22 /boot/vmlinuz-4.16.11-100.fc26.x86_64
    -rwxr-xr-x. 1 root root 8306872 May 25 23:37 /boot/vmlinuz-4.16.12-200.fc27.x86_64
    -rwxr-xr-x. 1 root root 8306872 May 30 17:19 /boot/vmlinuz-4.16.13-200.fc27.x86_64
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  6. #5
    Linux User
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    271
    Quote Originally Posted by blnl View Post
    Yes, the old kernels are removed after upgrade, only three last installed are kept.
    Code:
    [root@E7440-DELL boris]# ll /boot/vmlinuz-*
    -rwxr-xr-x. 1 root root 5751144 Jan  5  2016 /boot/vmlinuz-0-rescue-2b19506cad024a8da961a27bc6613d79
    -rwxr-xr-x. 1 root root 8302776 May 22 22:22 /boot/vmlinuz-4.16.11-100.fc26.x86_64
    -rwxr-xr-x. 1 root root 8306872 May 25 23:37 /boot/vmlinuz-4.16.12-200.fc27.x86_64
    -rwxr-xr-x. 1 root root 8306872 May 30 17:19 /boot/vmlinuz-4.16.13-200.fc27.x86_64
    So... You didn't read my other reply?

  7. #6
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    205
    Yes, I did read your other reply.
    It is not a solution but a workaround.
    Anyway I'm doing that already, no need to create an alias.

    I was hoping to understand the root-cause...
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  8. #7
    Linux User
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    271
    And I said what could be causing it.

  9. #8
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    205
    That is not correct, I'm pretty sure that Fedora did not change it's package manager to not upgrade GRUB automatically
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  10. #9
    Linux User
    Join Date
    Dec 2017
    Location
    Argentina
    Posts
    271
    Quote Originally Posted by blnl View Post
    That is not correct, I'm pretty sure that Fedora did not change it's package manager to not upgrade GRUB automatically
    First of all, "I'm pretty sure" should never follow "That is not correct".

    Second of all, try to retrace your steps. Maybe you messed something up. Did you change any setting you didn't understand lately?

    It could also be a bug. Did you find anyone having the same issue? Did you ask in the Fedora forums?

    Also, maybe someone rewrote dnf, downloaded it to your computer, compiled it and replaced it for the original dnf. Does that seem possible?

  11. #10
    Linux Newbie blnl's Avatar
    Join Date
    Jan 2009
    Location
    The Netherlands
    Posts
    205
    I'm not going to waste time and energy to investigate this. I will probably install a fresh fc27 during my summer holiday.

    "I'm pretty sure" is because two months ago I installed fc27-mate on my mothers computer and it does update grub after kernel upgrade.
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

Posting Permissions

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