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

余生长醉 提交于 2019-12-06 02:26:27

问题


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?


回答1:


I had similar problem.

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

2) In 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 didn't find it in manuals.

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

sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade



来源:https://stackoverflow.com/questions/26852572/how-to-avoid-grub-errors-after-running-apt-get-upgrade-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!