update-grub does not run on kernel updates

Bug #1928701 reported by Bas van der Lei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2-unsigned (Ubuntu)
New
Undecided
Unassigned

Bug Description

A fresh Ubuntu 18.04.5 installation (eg. from ubuntu-18.04.5-server-amd64.iso) on a EFI machine, will not run update-grub when a kernel is installed or removed. Resulting in an older kernel being booted or missing/broken entries in grub.cfg.

It seems the following pre/post hook scripts are missing:
    - `/etc/kernel/postinst.d/zz-update-grub`
    - `/etc/kernel/postrm.d/zz-update-grub`

This is due to a version mismatch of grub-efi-amd64 and grub2-common. In 2.04-1ubuntu44 of grub2 these scripts are installed as part of grub2-common package, while in 2.02-2ubuntu8.23 they are conffiles of the grub-efi-amd64 (or grub-pc, etc) package.

NOTE: A system that previously had an older version of grub-efi-amd64 or the grub-pc package installed will not encounter this issue since the scripts are still present as obsolete conffiles:

```
# dpkg --status grub-efi-amd64
<snip>
Conffiles:
 /etc/kernel/postrm.d/zz-update-grub 536d9d45e3e547638db3c5d58a925b6c obsolete
 /etc/kernel/postinst.d/zz-update-grub 536d9d45e3e547638db3c5d58a925b6c obsolete
```

---

```
$ lsb_release -rd
Description: Ubuntu 18.04.5 LTS
Release: 18.04

$ apt-cache policy grub-efi-amd64 grub2-common
grub-efi-amd64:
  Installed: 2.04-1ubuntu44
  Candidate: 2.04-1ubuntu44
  Version table:
 *** 2.04-1ubuntu44 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02-2ubuntu8.17 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     2.02-2ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
grub2-common:
  Installed: 2.02-2ubuntu8.23
  Candidate: 2.02-2ubuntu8.23
  Version table:
 *** 2.02-2ubuntu8.23 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02-2ubuntu8.17 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     2.02-2ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
```

---

Could also be the cause of #1922234 and #1927857

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.