Purging grub-pc package deletes /etc/default/grub file owned by grub-efi-amd64

Bug #1879466 reported by Daniel Richard G. on 2020-05-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

This concerns grub-pc 2.04-1ubuntu26 in Ubuntu focal.

I have the following packages installed. Note that grub-pc has been removed but not yet purged:

root@xubuntu:/# dpkg -l | grep grub
ii grub-common 2.04-1ubuntu26 amd64 GRand Unified Bootloader (common files)
ii grub-efi-amd64 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version)
ii grub-efi-amd64-bin 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
ii grub-efi-amd64-signed 1.142+2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version, signed)
rc grub-pc 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (PC/BIOS version)
ii grub-pc-bin 2.04-1ubuntu26 amd64 GRand Unified Bootloader, version 2 (PC/BIOS modules)
ii grub2-common 2.04-1ubuntu26 amd64 GRand Unified Bootloader (common files for version 2)

The /etc/default/grub file is owned by grub-efi-amd64, which is correct:

root@xubuntu:/# ucfq /etc/default/grub
Configuration file Package Exists Changed
/etc/default/grub grub-efi-amd64 Yes Yes

I then purge the grub-pc package, saying no to the "Remove GRUB 2 files?" debconf question:

root@xubuntu:/# apt-get purge grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  grub-pc*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database ... 254919 files and directories currently installed.)
Purging configuration files for grub-pc (2.04-1ubuntu26) ...
ucfr: Association belongs to grub-efi-amd64, not grub-pc
ucfr: Aborting
ucfr: Association belongs to grub-efi-amd64, not grub-pc
ucfr: Aborting

And then...

root@xubuntu:/# ls -l /etc/default/grub
ls: cannot access '/etc/default/grub': No such file or directory

The purging of grub-pc deleted a config file belonging to a different package, which is not only incorrect behavior, it could potentially leave the system unbootable after the next update-grub(8) invocation.

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

Other bug subscribers