内核升级后无人值守的grub配置

Modified on: Sat, 09 Jun 2018 06:30:53 +0800

今天我一直在努力自动部署ubuntu服务器。我使用apt-get upgrade尝试升级到新内核,无法自动更新服务器。日志看起来像这样:

Setting up linux-image-3.2.0-24-generic (3.2.0-24.39) ...
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
(...)

然后提出一个问题:

Package configuration

    ┌─────────────────────────────────┤  ├─────────────────────────────────┐    
    │ A new version of /boot/grub/menu.lst is available, but the version   │    
    │ installed currently has been locally modified.                       │    
    │                                                                      │    
    │ What would you like to do about menu.lst?                            │    
    │                                                                      │    
    │      install the package maintainer's version                        │    
    │      keep the local version currently installed                      │    
    │      show the differences between the versions                       │    
    │      show a side-by-side difference between the versions             │    
    │      show a 3-way difference between available versions              │    
    │      do a 3-way merge between available versions (experimental)      │    
    │      start a new shell to examine the situation                      │    
    │                                                                      │    
    │                                                                      │    
    │                                <Ok>                                  │    
    │                                                                      │    
    └──────────────────────────────────────────────────────────────────────┘    

期望的结果是选择第一个选项并继续:

Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

手动升级后,我使用debconf-get-selections来检查问题的正确答案(参见其他设置)。似乎update_grub_changeprompt_threeway是应该回答的问题。但是,使用debconf-set-selections进行设置会给我带来同样的问题:

debconf-set-selections <<< "grub grub/update_grub_changeprompt_threeway select install_new"
apt-get -y dist-upgrade

如何自动解决这个问题?

作者:bouke

最佳答案

在运行export DEBIAN_FRONTEND=noninteractive之前,我使用apt-get upgrade -y解决了这个问题。

作者:user76204,Joel Rebello

相关问答

添加新评论