1

I have a tripleboot of two debian 7.0 installs (one for development, one for gaming). I also have a full-disk-encrypted install of Kali Linux 2.0. When I did apt-get update && apt-get upgrade on the game machine, it updated grub and (I think) ran update-grub. The entries for Kali Linux and the dev-machine have disappeared from the grub screen. I know I can solve this by chrooting into the Kali install and running update-grub, but I don't want to chroot every time I update grub. I want to prevent the two Debian machines from updating grub. If it is possible, I would like to still be able to update the kernels on the Debian machines, but this is optional.

2

A better solution would be to add the appropriate files to /etc/grub.d on all your systems so that it's safe to run update-grub anywhere. I imagine that's documented but I haven't looked.

Nevertheless, assuming you'll manage your grub menus manually, you can disable the automatic update-grub on kernel installations (and removals) by removing /etc/kernel/postinst.d/zz-update-grub and /etc/kernel/postrm.d/zz-update-grub, or better yet, editing them to add exit 0 just after #! /bin/sh, so they start as follows:

#! /bin/sh
exit 0
set -e

That way it will be easier to undo the change if necessary.

7
  • Will this disable updating grub entirely or only on kernel update?
    – redfast00
    Dec 18 '15 at 9:44
  • Only on kernel updates. Dec 18 '15 at 9:45
  • So when I update grub on the debian machines, it will still update?
    – redfast00
    Dec 18 '15 at 9:45
  • Can you show me how to add the files in /etc/grub.d/?
    – redfast00
    Dec 18 '15 at 9:46
  • 1
    Yes, that would work; divert update-grub first with dpkg-divert --divert /usr/sbin/update-grub.real --rename /usr/sbin/update-grub, then ln -s /bin/true /usr/sbin/update-grub. Dec 18 '15 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.