mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-10-11 00:00:13 +08:00
[actions] never let an apt install wait on a prompt
Moving WSL package installs out of `setup-wsl`'s `additional-packages` lost its non-interactive setup: on Ubuntu 18.04, upgrading `libssl1.1` asks whether to restart services, and the job waited on that dialog until it was cancelled. Set `DEBIAN_FRONTEND=noninteractive`, keep existing config files without asking, and give apt no stdin.
This commit is contained in:
@@ -20,11 +20,14 @@ if [ "$(id -u)" != '0' ]; then
|
||||
fi
|
||||
|
||||
apt_get() {
|
||||
# never prompt: an upgrade (e.g. libssl asking to restart services) would wait forever
|
||||
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get \
|
||||
-o Acquire::Retries=5 \
|
||||
-o Acquire::http::Timeout=30 \
|
||||
-o Acquire::https::Timeout=30 \
|
||||
"$@"
|
||||
-o Dpkg::Options::=--force-confdef \
|
||||
-o Dpkg::Options::=--force-confold \
|
||||
"$@" < /dev/null
|
||||
}
|
||||
|
||||
ATTEMPT=1
|
||||
|
||||
Reference in New Issue
Block a user