Prevent Ubuntu auto-reboot during apt upgrade

This commit is contained in:
bigbong420 committed 2026-03-30 10:39:11 -04:00
1 parent cd9f0721a8
commit 8d7dd9bab3
1 file changed
+11
+11
View File
@@ -259,8 +259,19 @@ if [ "$IS_UBUNTU" = false ]; then
echo "deb https://packages.sury.org/nginx/ $CODENAME main" >> /etc/apt/sources.list echo "deb https://packages.sury.org/nginx/ $CODENAME main" >> /etc/apt/sources.list
fi fi
# Prevent Ubuntu from auto-rebooting during upgrade
if [ "$IS_UBUNTU" = true ]; then
systemctl mask needrestart.service 2>/dev/null || true
export NEEDRESTART_SUSPEND=1
export NEEDRESTART_MODE=l
fi
apt update -qq apt update -qq
DEBIAN_FRONTEND=noninteractive apt upgrade -y DEBIAN_FRONTEND=noninteractive apt upgrade -y
if [ "$IS_UBUNTU" = true ]; then
systemctl unmask needrestart.service 2>/dev/null || true
fi
log_ok "Repositories configured" log_ok "Repositories configured"
if [ "$SKIP_BINARIES" = true ]; then if [ "$SKIP_BINARIES" = true ]; then
log_step "Step 3: Skipping binary compilation (--skip-binaries)" log_step "Step 3: Skipping binary compilation (--skip-binaries)"