Xenial grub-install fails on amd64 due to removed grub-pc-bin package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
livecd-rootfs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I have found an interesting bug with grub on our cloud image builds for xenial. During the build `grub-install --target=i386-pc /dev/loop3` is called which calls `/usr/lib/
```
grub-install: error: /usr/lib/
```
We are seeing this now on xenial as `grub-pc-bin` is now removed during build as part of fixing bug LP#2036195 as `grub-pc-bin` is being purged as an autoremovable package.
The reason `grub-pc-bin` is autoremovable is because the `grub-pc` package was removed when `apt-get install -qqy grub-efi-
We are not seeing this on newer releases as `grub-pc` is still installed, and thus, so too is `grub-pc-bin`
There were previous changes in this area [1] related to grub installs which would have resolved this issue as part of LP#1901906 but they were reverted for xenial [2][3]
Without making further grub changes the solution is to mark `grub-pc-bin` as manually installed so even if `grub-pc` is removed the `grub-pc-bin` is not marked autoremovable.
[1] https:/
[2] https:/
[3] https:/
Related branches
- Steve Langasek: Approve
- Andrew Cloke (community): Approve
-
Diff: 29 lines (+10/-0)2 files modifieddebian/changelog (+6/-0)
live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary (+4/-0)
Changed in livecd-rootfs (Ubuntu): | |
status: | Confirmed → Fix Released |
I had discussed this with juliank too to see if this could be fixed by updating the dependencies of grub2-common to include grub-pc-bin but this is not a path we wish to take.
It is expected that grub-install can't install targets you haven't installed. grub-pc is the only thing calling grub-install with the i386-pc target and if you want to run grub-install yourself for a specific target you have to make sure to install that target first.
As such the proposed solution is to apt-mark manual grub-pc-bin so it will not be autoremoved.