There is a very similar question here "How do I apt-get -y dist-upgrade without a grub config prompt?" about updating grub without the prompt using apt-get.
However I would like to to know how to install grub2 with apt-get on a brand new image. I am preparing virtual machine disk images starting with debootstrap and going from there.
I would like to install the grub2 software on an image - but not configure it or install it on the boot sector at all ; a later script takes care of configuration and installation proper.
How can I do this?