-
Notifications
You must be signed in to change notification settings - Fork 19
/
upgrade.sh
22 lines (17 loc) · 790 Bytes
/
upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -euxo pipefail
# wait for cloud-init to finish.
cloud-init status --long --wait
# let the sudo group members use root permissions without a password.
# NB d-i automatically added the vagrant user into the sudo group.
sed -i -E 's,^%sudo\s+.+,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
# configure apt for non-interactive mode.
export DEBIAN_FRONTEND=noninteractive
# disable unattended upgrades.
# NB it interferes with our automation with errors alike:
# E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 17599 (unattended-upgr)
# E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
apt-get remove -y --purge unattended-upgrades
# upgrade.
apt-get update
apt-get dist-upgrade -y