Bug#1134186: grub2-common: grub-mkconfig keeps a package that has been removed
Vincent Lefevre
vincent at vinc17.net
Fri Apr 17 16:00:48 BST 2026
Control: retitle -1 grub2-common: grub-mkconfig keeps a menu entry for a kernel whose initrd.img has been removed
Control: found -1 2.12-9
On a different machine, which still has grub2 2.12-9, there is the
same issue:
disset:~> grep "menuentry 'Debian GNU/Linux, with Linux" /boot/grub/grub.cfg
menuentry 'Debian GNU/Linux, with Linux 6.19.11+deb14-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.19.11+deb14-amd64-advanced-d0d6b264-7587-42d0-81f6-18e89ce77d2d' {
menuentry 'Debian GNU/Linux, with Linux 6.19.11+deb14-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.19.11+deb14-amd64-recovery-d0d6b264-7587-42d0-81f6-18e89ce77d2d' {
menuentry 'Debian GNU/Linux, with Linux 6.19.10+deb14-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.19.10+deb14-amd64-advanced-d0d6b264-7587-42d0-81f6-18e89ce77d2d' {
menuentry 'Debian GNU/Linux, with Linux 6.19.10+deb14-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.19.10+deb14-amd64-recovery-d0d6b264-7587-42d0-81f6-18e89ce77d2d' {
but /boot contains only
-rw-r--r-- 1 root root 93 2026-04-05 08:17:47 System.map-6.19.11+deb14-amd64
-rw-r--r-- 1 root root 296476 2026-04-05 08:17:47 config-6.19.11+deb14-amd64
drwx------ 3 root root 4096 1970-01-01 01:00:00 efi/
drwxr-xr-x 5 root root 1024 2026-04-17 16:42:35 grub/
-rw-r--r-- 1 root root 180481934 2026-04-07 12:31:34 initrd.img-6.19.11+deb14-amd64
drwx------ 2 root root 12288 2024-01-05 16:33:11 lost+found/
-rw-r--r-- 1 root root 13936576 2026-04-05 08:17:47 vmlinuz-6.19.11+deb14-amd64
This can also be seen:
root at disset:/home/vlefevre# apt purge linux-image-6.19.10+deb14-amd64
REMOVING:
linux-image-6.19.10+deb14-amd64*
Summary:
Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 27
Freed space: 16.4 kB
Continue? [Y/n]
(Reading database ... 501250 files and directories currently installed.)
Removing linux-image-6.19.10+deb14-amd64 (6.19.10-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.19.11+deb14-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.19.11+deb14-amd64
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.19.10+deb14-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found background image: .background_cache.png
Found linux image: /boot/vmlinuz-6.19.11+deb14-amd64
Found initrd image: /boot/initrd.img-6.19.11+deb14-amd64
Found linux image: /boot/vmlinuz-6.19.10+deb14-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
(Reading database ... 501247 files and directories currently installed.)
Purging configuration files for linux-image-6.19.10+deb14-amd64 (6.19.10-1) ...
rmdir: failed to remove '/lib/modules/6.19.10+deb14-amd64': Directory not empty
root at disset:/home/vlefevre# apt autoremove --purge
REMOVING:
linux-base-6.19.10+deb14-amd64* linux-modules-6.19.10+deb14-amd64*
linux-binary-6.19.10+deb14-amd64*
Summary:
Upgrading: 0, Installing: 0, Removing: 3, Not Upgrading: 27
Freed space: 118 MB
Continue? [Y/n]
(Reading database ... 501247 files and directories currently installed.)
Removing linux-binary-6.19.10+deb14-amd64 (6.19.10-1) ...
Removing linux-modules-6.19.10+deb14-amd64 (6.19.10-1) ...
Removing linux-base-6.19.10+deb14-amd64 (6.19.10-1) ...
The issue seems to be that the /boot/vmlinuz-6.19.10+deb14-amd64 found
above is in linux-binary-6.19.10+deb14-amd64, but when it got removed,
the GRUB configuration was not updated. But I suppose that looking at
vmlinuz is wrong since it may be kept while the initrd.img has already
been removed.
When I installed the 6.19.12+deb14-amd64 kernel, 6.19.10+deb14-amd64
got removed from /boot/grub/grub.cfg as expected.
--
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
More information about the Pkg-grub-devel
mailing list