5

I am following these instructions- https://help.ubuntu.com/community/AutomaticSecurityUpdates on Ubuntu 10.04 LTS Server 64 bit.

The problem is that when the update script is executed, it gets stuck because GRUB is asking a question "You chose not to install GRUB to any devices. If you continue, the boot loader may not be properly configured, and when this computer next starts up it will use whatever was previously in the boot sector"

How do I make automated install work? Is there a way to blacklist a particular update to a package.

user837208
  • 315
  • 1
  • 3
  • 6

2 Answers2

2

Reconfigure the grub-pc package

sudo dpkg-reconfigure -plow grub-pc

When asked about the partition or disk to install Grub to, choose one, or just skip the options and click OK if you don't want Grub to be installed anywhere.


Then check the options

debconf-show grub-pc

You should see the key grub-pc/install_devices set to the disk/partition you've chosen, or grub-pc/install_devices_empty set to true if you chose not to install Grub.


Then if you test this by reinstalling the package

sudo apt-get --reinstall install grub-pc

you should not be asked any You chose not to install GRUB to any devices questions anymore.

arrange
  • 14,727
  • 4
  • 42
  • 32
  • 1
    Thanks! I however need to do this automatically and not interactively. Any ideas? – user837208 Nov 26 '11 at 20:53
  • 1
    You do this interactively once. Then you should not be prompted anymore. – arrange Nov 26 '11 at 21:02
  • Have you solved this problem? I need to do it automatically too. – Fa11enAngel Jul 30 '13 at 09:28
  • Check the comment for full automation http://feeding.cloud.geek.nz/posts/manipulating-debconf-settings-on/ – michael.schuett Nov 12 '14 at 17:08
  • Sometimes `grub-pc` install asks questions about the configuration file if there are differences. In this case, you can automate using `-o Dpkg::Options::="--force-confnew"` or one of the other options. https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/ – Utkonos Nov 02 '22 at 22:25
0

I don't have enough clout on AskUbuntu to post a comment; so this is going in as a solution. You can do what @arrange said to do via command line with:

echo "SET grub-pc/install_devices /dev/sda" | debconf-communicate

Just put that at the top of your script, and it won't ask you for input anymore. Incidentally, that also saves you from having your terminal garbled so that it looks like it's written in Klingon if your bash script does miraculously blow through the grub config curses menu.