How to upgrade Ubuntu 18 LTS in stackscript.
I have a stackscript to update Ubuntu, create some users with keys, setup mysql, nginx etc. The problem is, apt-get upgrade -y fails because it asks for keyboard (twice), then asks what to do with existing GRUB file (need to keep current one), then it asks which disk the boot loader was installed on (always shows /dev/sda, /dev/sdb, then /dev/sda again (which is strange). First one seems to work. Does anyone have a script to do this non-interactively in a stack script?
Any ideas for automating this? The other option is to do the upgrade manually after the install, but this tends to break our nginx and mysql installations.
1 Reply
hello @skyfall
Try this:
sudo DEBIAN_FRONTEND=noninteractive
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
OR
just put sudo DEBIAN_FRONTEND=noninteractive before your apt-get upgrade -y line
this would use the default answer for any questions a package might ask.