Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid GRUB errors after running apt-get upgrade - Ubuntu [closed]

I'm running ubuntu 14.04 on an EC2

After running apt-get upgrade

I'm prompted with a screen that asks me to reinstall GRUB boot loader

The GRUB boot loader was previously installed to a disk that is no longer present, or whose unique identifier has changed for some reason. It is important to make sure that the installed GRUB core image stays in sync with GRUB modules and grub.cfg. Please check again to make sure that GRUB is written to the appropriate boot devices.

  • How do I know which device should I select?

  • What if I have mounted on my machine some additional EBS, should I select them as well?

  • Can I avoid this prompt, during the upgrade or supply some defaults to the command?

The following prompt is

A new version of /boot/grub/menu.lst is available, but the version installed currently has been locally modified.

  1. install the package maintainer's version
  2. keep the local version currently installed
  3. show the differences between the versions
  4. show a side-by-side difference between the versions
  5. show a 3-way difference between available versions
  6. do a 3-way merge between available versions (experimental)
  7. start a new shell to examine the situation

The same q's here:

  • How do I know which one should I select?

  • Can I avoid this prompt, during the upgrade or supply some defaults to the command?

like image 669
Ofer Velich Avatar asked Nov 10 '14 20:11

Ofer Velich


1 Answers

I had similar problem.

1) If you take a look man apt-get, you will find a configuration option-o. It allows to set options for Debian package manager dpkg.

2) In the manual man dpkg you can find set of options --force-confdef(force to keep default option without prompting) and --force-confold (force to keep old conf files)

In some sources I found, that people pass env variable DEBIAN_FRONTEND=noninteractive as well, but I could not find it in any manual.

So, the final command in .sh script, that I use to run upgrade:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
like image 127
antonbormotov Avatar answered Oct 11 '22 18:10

antonbormotov