Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Set needrestart to non-interactive mode in install.sh

Juan Denis8cff8f98aef5
diff --git a/.gitignore b/.gitignore
index 8c0379fd..967714db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,5 @@ nul
*.tmp
.planning_old
.mcp.json
-new_templates/
\ No newline at end of file
+new_templates/
+/.marketing
diff --git a/install.sh b/install.sh
index 1bd91896..d1683f82 100644
--- a/install.sh
+++ b/install.sh
@@ -60,6 +60,18 @@ fi
echo ""
print_info "Installing system dependencies..."
+# Configure needrestart for non-interactive mode (Ubuntu 22.04+)
+# This prevents the "Which services should be restarted?" dialog
+# and avoids dpkg lock issues during automated installs
+export NEEDRESTART_MODE=a
+export DEBIAN_FRONTEND=noninteractive
+
+# Also configure needrestart.conf if it exists for future apt operations
+if [ -f /etc/needrestart/needrestart.conf ]; then
+ # Set needrestart to auto-restart mode
+ sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf 2>/dev/null || true
+fi
+
# Update package list
apt-get update