运行apt-get升级后如何避免GRUB错误-Ubuntu [英] How to avoid GRUB errors after running apt-get upgrade - Ubuntu

查看:481
本文介绍了运行apt-get升级后如何避免GRUB错误-Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在EC2上运行ubuntu 14.04

I'm running ubuntu 14.04 on an EC2

运行apt-get升级后

After running apt-get upgrade

m出现一个屏幕,提示我重新安装GRUB引导加载器

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


GRUB引导加载器以前已安装到不再存在的磁盘上,或由于某些原因其唯一标识符已更改。确保已安装的GRUB核心映像与GRUB模块和grub.cfg保持同步非常重要。请再次检查以确保将GRUB写入适当的引导设备。

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?

      如果我在计算机上安装了一些附加的EBS怎么办,我也应该选择它们吗?

      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?

      以下提示是


      有一个新版本的/boot/grub/menu.lst,但是当前安装的版本已在本地进行了修改。

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


      1. 安装软件包维护者的版本

      2. 保留当前安装的本地版本

      3. 显示版本之间的差异

      4. 显示版本之间的并排差异

      5. 显示3向差异可用版本之间

      6. 在可用版本之间进行三向合并(实验)

      7. 启动新的外壳以检查情况

      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


      相同的q在这里:


      • 我怎么知道我应该选择哪个?

      • How do I know which one should I select?

      在升级过程中是否可以避免出现此提示,或者为该命令提供一些默认设置? ?

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

      推荐答案

      我也遇到了类似的问题。

      I had similar problem.

      1)如果您看一下 man apt-get ,您会发现一个配置选项 -o
      它允许为Debian软件包管理器 dpkg 设置选项。

      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)在手册 man dpkg ,您可以找到选项集-force-confdef (强制保留默认选项而不提示)和-force-confold (强制保留旧的conf文件)

      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)

      在我发现的某些来源中,人们传递了env变量 DEBIAN_FRONTEND = noninteractive 也是如此,但是我在任何手册中都找不到。

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

      因此,中的最后一条命令。 sh脚本,我用于运行升级:

      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
      

      这篇关于运行apt-get升级后如何避免GRUB错误-Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆