#1127624 grub2-common: upgrade yields inconsistent /usr/share/doc, breaking "dpkg -S"

Package:
grub2-common
Source:
grub2-common
Description:
GRand Unified Bootloader (common files for version 2)
Submitter:
Vincent Lefevre
Date:
2026-04-19 11:59:02 UTC
Severity:
normal
#1127624#5
Date:
2026-02-10 16:53:10 UTC
From:
To:
After I upgraded grub from 2.12-9 to 2.14-1 and removed the resulting
grub-common dummy package, which gave the warning

dpkg: warning: while removing grub-common, directory '/usr/share/doc/grub-common' not empty so not removed

I now have

lrwxrwxrwx 1 root root 11 2015-09-06 03:13:12 /usr/share/doc/grub2-common -> grub-common/

where grub-common contains the files, but this breaks "dpkg -S":

cventin:~> dpkg -S /usr/share/doc/grub-common
dpkg-query: no path found matching pattern /usr/share/doc/grub-common

grub2-common 2.12-9 had the above symlink:

lrwxrwxrwx root/root         0 2025-07-03 18:35:51 ./usr/share/doc/grub2-common -> grub-common

but grub2-common 2.14-1 has

drwxr-xr-x root/root         0 2026-02-05 11:50:50 ./usr/share/doc/
drwxr-xr-x root/root         0 2026-02-05 11:50:50 ./usr/share/doc/grub2-common/
-rw-r--r-- root/root       669 2018-11-24 18:13:02 ./usr/share/doc/grub2-common/AUTHORS
-rw-r--r-- root/root       242 2026-02-05 11:50:50 ./usr/share/doc/grub2-common/NEWS.Debian.gz
-rw-r--r-- root/root      9594 2026-01-14 16:46:20 ./usr/share/doc/grub2-common/NEWS.gz
-rw-r--r-- root/root      1043 2021-06-08 14:15:20 ./usr/share/doc/grub2-common/README
-rw-r--r-- root/root      1398 2018-11-24 18:13:02 ./usr/share/doc/grub2-common/THANKS
-rw-r--r-- root/root       318 2018-11-24 18:13:02 ./usr/share/doc/grub2-common/TODO
-rw-r--r-- root/root     16905 2026-02-05 11:50:50 ./usr/share/doc/grub2-common/changelog.Debian.gz
-rw-r--r-- root/root    376801 2026-01-14 19:46:54 ./usr/share/doc/grub2-common/changelog.gz
-rw-r--r-- root/root     22963 2026-02-05 11:50:50 ./usr/share/doc/grub2-common/copyright
drwxr-xr-x root/root         0 2026-02-05 11:50:50 ./usr/share/doc/grub2-common/examples/
-rw-r--r-- root/root      1705 2018-11-24 18:13:02 ./usr/share/doc/grub2-common/examples/grub.cfg

So something bad occurred during the upgrade. I suppose that the
symlink /usr/share/doc/grub2-common should have been dropped first,
so that the above files could have been installed directly in a
real directory "/usr/share/doc/grub2-common".

#1127624#10
Date:
2026-02-10 16:59:57 UTC
From:
To:
And other symbolic links should have been updated:

cventin:~> ls -ld /usr/share/doc/grub*
drwxr-xr-x 3 root root 4096 2026-02-10 17:06:39 /usr/share/doc/grub-common
lrwxrwxrwx 1 root root   11 2015-09-06 03:13:12 /usr/share/doc/grub-pc -> grub-common
lrwxrwxrwx 1 root root   11 2015-09-06 03:13:12 /usr/share/doc/grub-pc-bin -> grub-common
lrwxrwxrwx 1 root root   11 2015-09-06 03:13:12 /usr/share/doc/grub2-common -> grub-common

i.e. grub-pc and grub-pc-bin should point to grub2-common
(which should have been a real directory, and probably is
after a new installation, and grub-common should have been
no longer there after the grub-common package got removed).

#1127624#17
Date:
2026-03-12 07:27:37 UTC
From:
To:
Hi,


So does 2.14~git20250718.0e36779-2 (current testing):

paul@toba ~ $ dpkg -S /usr/share/doc/grub2-common
grub2-common: /usr/share/doc/grub2-common
paul@toba ~ $ apt list grub2-common
grub2-common/testing,now 2.14~git20250718.0e36779-2 amd64
[installed,automatic]
paul@toba ~ $ ls -ald /usr/share/doc/grub2-common
lrwxrwxrwx 1 root root 11 Oct  2  2023 /usr/share/doc/grub2-common ->
grub-common

Paul

#1127624#22
Date:
2026-04-02 11:51:58 UTC
From:
To:
Hi,

found 1127624 2.14~git20250718.0e36779-2

I checked contents the packages in the repo at deb.debian.org:
the bug already exists in grub2-common 2.14~git20250718.0e36779-2, which is
already in testing.

With this in mind, migrating 2.14-2 to testing would not make things worse ;-]

But of course the issue should be fixed nonetheless.
Would a simple `rm /usr/share/doc/grub2-common || true` in preinst do the
trick?

Best
Peter