Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Virtual machine apt-get grub issue [duplicate]

I've exported a completely done VM image from Virtualbox and am trying to do an unattended setup with a script I created. So, when I get to apt-get upgrade this window eventually pops up which is making my script hang. The user should not have to do interact with the setup at all.

How can I get past this automatically for the user? Or just ignore the grub update?

grub-pc

Thanks!

like image 963
Godzilla74 Avatar asked Nov 22 '16 17:11

Godzilla74


People also ask

How do I reinstall grub2?

boot the Linux installation manually from Grub2 command prompt. run 'grub-install' from Linux to reinstall the Grub2 boot code to a partition. run 'update-grub' or 'grub2-mkconfig' from Linux to generate a new copy of grub. cfg.

How do I reinstall grub in rescue mode?

Reinstall Ubuntu GRUB Boot Loader. 1. After you've downloaded and burned the Ubuntu ISO image, or created a bootable USB stick, place the bootable media into your appropriate machine drive, reboot the machine and instruct the BIOS to boot into Ubuntu live image.

Where should I install GRUB bootloader?

The GRUB 2 files will normally be located in the /boot/grub and /etc/grub. d folders and the /etc/default/grub file in the partition containing the Ubuntu installation. If another Ubuntu/Linux distribution controlled the boot process, it will be replaced by the GRUB 2 settings in the new installation.


1 Answers

Try this:

apt-get -y upgrade

and if that does not work, try this:

DEBIAN_FRONTEND=noninteractive apt-get -y upgrade

Please note: using the code above would just simply tell the system to choose the default answer for each question (do you always want the default answer? think about that).

Edit: there's one more situation in which the system could still ask the user to interact with the upgrade: if you manually modified a configuration file of a program that will be updated, the system may halt the upgrade and ask you whether you want to keep the old configuration file or overwrite it with the new configuration file. The code below would avoid the system asking the user to make this choice:

DEBIAN_FRONTEND=noninteractive apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" upgrade

Regarding the configuration file, the code above would instruct the system to:

1) Check if the package being installed specifies by default that the new configuration file should be installed - if that is the case, then the new configuration file will be installed and overwrite the old one.

2) If the package being installed does not specify by default that the new configuration file should be installed, then the old configuration file would be kept - that is very useful, specially when you customized the installation of that package.

like image 116
Jamil Said Avatar answered Oct 05 '22 09:10

Jamil Said